Currently, I have a xamarin app that has a database, web service and 2 other services to handle the logic between the database/web service and the ui. I'm trying to make it all async, and therefore I am having race condition issues occur. For the view models, I am using DI. While with the services I am treating them like I treat the navigation and putting them in
SimpleIoc. Instantiating these services all occur in
App.Xaml.cs. my issue is that the 2 other logic services are dependent on the web and database services. If one of those for some reason don't get initialized quick enough, then the 2 devices return null exception on those items. And because I create these services in
App.xaml.cs, I can't do the
.ContinueWith() on my asynchronous initializing methods.
My questions are then, what would be a better way to do notify my two services when the web and database services are ready to use, how do I queue up calls to these services when they are initializing, and is there a better approach to what I am doing?