I'm currently trying to use the same DbContext (I have two databases of the same structure) in my application. I'm not quite sure what I'm doing wrong, but here is my current code - I hope this will be pretty obvious what I'm trying to do. I am using the first EF database (which, apparently, does not indicate an error below).
My context is factory code:
public class HOLContextFactory
{
public static HOLDbEntities Create()
{
return new HOLDbEntities();
}
public static HOLDbQuoteEntities CreateQuote()
{
return new HOLDbQuoteEntities();
}
}
public partial class HOLDbQuoteEntities : HOLDbEntities
{
public HOLDbQuoteEntities()
: base("HOLDbQuoteEntities")
{
}
}
Web.config connection strings:
<add name="HOLDbEntities" connectionString="metadata=res://*/HOLDbContext.csdl|res://*/HOLDbContext.ssdl|res://*/HOLDbContext.msl;provider=System.Data.SqlClient;provider connection string=<connstringdetails>" providerName="System.Data.EntityClient" />
<add name="HOLDbQuoteEntities" connectionString="metadata=res://*/HOLDbContext.csdl|res://*/HOLDbContext.ssdl|res://*/HOLDbContext.msl;provider=System.Data.SqlClient;provider connection string=<connstringdetails>" providerName="System.Data.EntityClient" />
Error using "HOLDbQuoteEntities":
, T4 First Model , Code First. First Model First, , Entity . , , API DbModelBuilder, , **