I have a asp.net mvc web application to display a table in the view.
Also I have a data access project (it is a class library, the dll of this project will be put into the above MVC project and accessing data in that).
My web application doesn't do the data access things. The class library takes it. It contains the connection string in app.config and entity framework data context is also in the library. Now the library works well in console application. But it fails in the web application because the connection string is empty.
Basically in the class library, the connection string can be obtained:
public class EndpointManagement : IEndpointManagement
{
public string GetConnectionString(MyDataContext context)
{
return ConfigurationManager.AppSettings["connectionString"];
}
}
Not sure how to deal with it in web application????