title: .Net core N Tier application -: Share data access layer between multiple Web API projects
body: <p>I have a .Net core Web API application which is using N Tier approach i.e, Web API Controllers -&gt; BL Layer -&gt; DAL. We are using EF Core in DAL, &amp; we have another layer where we are setting up our DB connection using composition root concept i.e, we have a class file &amp; there we have a static extension method which we are calling from inside configureServices method of startup.cs file of our Web API &amp; passing the Iservicecollection 'services' property &amp; the connection string.</p>
  <p>Inside the extension method, I am setting up the DI such as services.AddDBContext&lt;&gt;(), services.AddScoped&lt;Irepo, repoImpl&gt;.</p>
  <p>Now within the same solution, we have another new Web API project but how to call the same DAL layer?? The problem that I can see is, for this new Web API project, we have to call the same composition root class &amp; pass in the Iservicecollection 'services' property &amp; also the connection string. This will cause problem. Is there any way to achieve this or this approach is completely wrong??</p>