3 ms·
You can use the DI stuff without ASP.Net Core though?
by thejosh 8y ago
You can use the DI stuff without ASP.Net Core though?
- ahoka 8y agoYes, you can. If you don't need anything fancy (in that case you are better off with autofac), then you can just add the nuget to your console app and start using it with a few lines of code.
- merb 8y agoto be fair autofac is not really needed in most projects. you can even write a bunch of lines that will automatically register all your controller dependencies. (of course autofac makes this more simple). but I actually prefer explicit registration (i had the implicit variant on guice and as soon as the project was big, implicit is a mess).
- joshschreuder 8y agoThere's also Scrutor (https://github.com/khellang/Scrutor https://github.com/khellang/Scrutor) which makes assembly scanning and registering dependencies really easy too