Pearl (asyncmeow)
IEnumerable<T> (or List<T>, or T[]) to IEnumerable (non-generic, ie. no type param)?
Hello,
I'm working on some code that takes an
object
that may be either an object T
itself, or some form of an IEnumerable<T>
. The thing is, I don't actually know T
in this context (as it's a asp.net IActionFilter
). How would I check if that object is an IEnumerable
and if it is, get the object as that IEnumerable
to iterate over it?2 replies
❔ Error in iOS MAUI app when trying to use WebAuthenticator
Hello! I'm trying to write a simple mobile app that hits my own API. I wrote a wrapper for the API that triggers a new authentication with WebAuthenticator.AuthenticateAsync if there's no valid authentication session. This works if I trigger a new auth session from a button, but trying to do an API request when a view loads (from OnAppearing) gives me this on iOS:
Is there a specific place I should be doing this in on view initialization in order to immediately pop up the login prompt (if needed) when a view is opened?
(fwiw - if this is something that would normally get an app removed from the app store, it's not really an issue I care about - this is an app only for my personal use, and has other stuff that would probably get it removed anyway like using SSO but not having appleid support for SSO 😅 )
2 replies