I am trying to set the connection string dynamically in my database first MVC web applications. This is the code that I've come up with but it keeps erroring with
Keyword not supported: 'metadata'.
I'm aware that there are other similar qustions on Stackoverflow but none of the solutions have solved my problem
This is the code that I'm using
public partial class DevTS_mtEntities : DbContext
{
public DevTS_mtEntities(string conn)
{
this.Database.Connection.ConnectionString = "metadata=res://*/Setup.Questions.Questions.csdl|res://*/Setup.Questions.Questions.ssdl|res://*/Setup.Questions.Questions.msl;provider=System.Data.SqlClient;provider connection string=\"data source=<server>;initial catalog=DevTS_mt;user id=<user>;password=<password>;MultipleActiveResultSets=True;App=EntityFramework\"";
}
}