Solution:
1. Replace dbo. to Empty for Project
2. create 2 connectionStrings in web.config
one is common
second is admin
example :
<add name="adminConnection" connectionString="xxx" / >
<add name="xxx" connectionString="xxx" / >
2. Context page add this code
public class reportContext: DbContext { public reportContext()
: base("name=adminConnection")
{
}
public DbSet<Product> Products { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Conventions.Remove<PluralizingTableNameConvention>(); }
}
No comments:
Post a Comment