jeudi 29 juillet 2021

Singleton with Dependency Injection in ASP.NET Core

We can inject dependency thanks to: services.AddSingleton() in .NET Core. Is there any aim of creating a special class(Singleton) with special body (private constructor, static GetInstance() etc.) Shouldn't we just use the services.AddSingleton() with a "normal" class?

Aucun commentaire:

Enregistrer un commentaire