I am working on Web API Core 2.2 and need to design 3 tier architecture. How can I do it.
My Project Structure as below
In Web API Project..
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<HrmsDbContext>(opt =>
opt.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
}
In DAL (Library project, I have made my DBContext and provided connectionstring like below.
Is there any better so that I had not provide connectionstring at two places? and write 3 tier architecture in good way.
Any help will be appreciated.
Aucun commentaire:
Enregistrer un commentaire