title: How to read connection string inside .NET Standard Class library project from ASP.NET Core
body: <p>In my solution, I have a ASP.NET Core web project and a .NET Standard class library project. Class library project is the data access layer and I want to read the connection string from my appsettings.json (ASP.NET Core project) in my data access layer. </p>
  
  <p>I have found few answers such as by <a href="https://stackoverflow.com/questions/43389530/how-to-get-connection-string-in-class-library-project">Andrii Litvinov</a> which looks like quite straight forward to implement but he also mentioned about implementing through Dependency Injection. I don't want to choose the easy shortcut way but looking for the dependency injection implementation?</p>
  
  <p>I am not sure if having appsettings.json in my class library and then registering it through IConfigurationRoot is the better option (as explained <a href="https://stackoverflow.com/questions/45796776/get-connectionstring-from-appsettings-json-instead-of-being-hardcoded-in-net-co/45845041#45845041">here</a> by JRB) but in my scenario, the connection string is in the appsettings.json file of the web project and I wan't constructor dependency injection implementation in my class library project to consume the connection string.</p>