I have a layered architecture for a project as follows.
MyProject.Web <-- ASP.NET Core app
MyProject.BusinessLogic <-- Class Library
MyProject.DataAccess <-- Class Library
Web
project references BusinessLogic
, which in turn references DataAccess
.
The connection string is stored in appsettings.json
in Web
project as follows.
{
"ConnectionStrings": {
"LocalDatabase": "Server=..."
},
// ...
}
}
How do I get a connection string in the DataAccess
project?