3 ms·
its very simple to get .net core DI working, shouldn't be much code other than registering your types / service. await new HostBuilder().ConfigureServices((con
by keithnz 7y ago
its very simple to get .net core DI working, shouldn't be much code other than registering your types / service.
await new HostBuilder().ConfigureServices((context, services) => { // services.AddTransient.... }).UseConsoleLifetime().Build.RunAsync()
- mieseratte 7y agoI’m talking DI for ASP.NET MVC 5, non-Core. That required a custom provider (trivial), and non-obviously a custom ControllerFactory as I picked Core DI instead of a more fully-fledged solution. Unfortunately there is very little obviousness in documentation and germs often get conflated and confused. Perhaps this is MS trying to get me to take one of their infamous certification courses?
- avgDev 7y agoThat is because MVC 5 did not support DI out of the box. This has been fixed with Core. It is quite easy now, since I was able to figure it out haha.