News for hackers. Stuff that matters.
Re:Astonishing Performance of .NET 5 by shireboy on Thursday November 12, 2020 @03:38PM (#25074639)
Actually, as written, myService never gets set, but I think I know what you mean. This is not thread-safe and assumes you want singleton. To use it you would in each controller do:

var service = Startup.getMyService();

And potentially know if the controller should dispose service.

This doesn't seem much less "in the way" or "massive" than:

services.AddSingleton<IMyService,MyService>();

There are no comments on this comment yet.