Re:Astonishing Performance of .NET 5
by bebop on Thursday November 12, 2020 @11:04AM
(#25071249)
If you understand Spring then Asp.net Core will feel right at home. I think .Net tends to be more explicit in the configuration, with DI being no exception. For instance, in Spring you can just annotate a service with @Service and the DI framework will pick that up. In Asp.net Core, you actually have to say IThing is backed by Thing as a singleton when running the application and TestThing when running tests.
Edit: Also as others have noted, constructor injection is the way to do DI.
Edit: Also as others have noted, constructor injection is the way to do DI.