lucabriguglia / Weapsy

ASP.NET Core CMS
http://www.weapsy.com
Other
10 stars 2 forks source link

Remove Autofac dependency. #24

Open mikeandersun opened 7 years ago

mikeandersun commented 7 years ago

It is possible to remove Autofacdependency and use .NetCoreDI system? Or there is any restrictions in .netcore DI?

lucabriguglia commented 7 years ago

Yes it is, you have to modify the ConfigureServices method in Startup.cs and create a new implementation of the Weapsy.Infrastructure.DependencyResolver.IResolver (and register it, the default one is AutofacResolver)

lucabriguglia commented 7 years ago

Remember that the Text app registers the services with Autofac as well, use the ConfigureServices method in https://github.com/weapsy/Weapsy/blob/master/src/Apps/Weapsy.Apps.Text/Startup.cs to register the relevant services.

lucabriguglia commented 7 years ago

I'll make the IOC configurable in the appsettings.json. That means that you can use an IOC of your choice and add a custom implementation of Weapsy.Infrastructure.DependencyResolver.IResolver based on it.

lucabriguglia commented 6 years ago

I decided to completely remove the dependency of Autofac and use the default service provider.