I want to move my project to ASP.NET Core framework. I'm new in asp.net core so don't know how to work with UnitOfWork pattern there. When I worked with asp.net mvc, I divided solution into 3-tier architecture(DAl,BLL,WEB layers). In BLL tier I used Ninject injection, so I didn't need to add reference to DLL from my WEB layer.
public class ServiceModule : NinjectModule
{
private string connectionString;
public StandardKernel _kernel;
IUnitOfWork uow;
public ServiceModule(string connection)
{
connectionString = connection;
uow = new EFUnitOfWork(connectionString);
}
public override void Load()
{
Bind<IUnitOfWork>().To<EFUnitOfWork>().WithConstructorArgument(connectionString);
}
}
But all tutorials say in ASP.NET Core applications should use core injection in ConfigureServices(WEB layer) method like that:
services.AddTransient<IUnitOfWork, EFUnitOfWork>();
However, it's bad idea to add reference to add a reference to DAL layer from WEB.
So, what should I do?Add reference(don't think so) or edit my structure?Or maybe something else?