Closed anhlee24 closed 8 years ago
A better way to make singletons is to use the dependency injection framework. Just make a normal class and register it as a singleton during Startup :
services.AddSingleton<MyInterface, MyClass>();
In this class you inject the IUowProvider via the constructor and the dependency injection framework will instantiate it, since it is also registered (as a singleton actually) :
You can find more on the dependency injection framework in .NET Core docs. Look for the lifetime section
Thank you! My problem resovled!
How can i create an instance of IUowProvider?
I have a singleton class like this and need to create instance:
` public class SystemConfig : ISystemConfig