I have a class that I am going to load as Singleton to store data for use across my Blazor web app.
My issues is that the class also requires services that I added.
Is it possible to instantiate a class as singleton and load the data with services I've implemented?
Some of the data to be loaded is retrieved with Async calls which is why I have the Initialize and not just using the constructor.
Below is what I currently have. If I need myAppData to access GraphServices, how do I do that while also loading myAppData as a service?
AppData myAppData = AppData.Initialize;builder.Services.AddTransient<IGraphServices, GraphServices>();builder.Services.AddSingleton(myAppData);