I have two tables namely Table1 ,Table2 and two schemas Sch1,Sch2 in my database and the tables present in both the schemas.
i have a UI page which contains, a drop down and three tabs.
From a UI page, user will select one schema from the drop down, then the data related to that schema should be loaded to a grid. user has an option to create a new schema with tables mentioned above. that means in future we may get lot of schemas each with the same table structure.
I need to design a data model, that handles all these. as the schema names can be changing, i need to create more dynamic kind of Entity Framework.
can anybody suggest best way to do it?
I did it in the Following way:
Class myDataContext: DbContext
static string targetSchema=string.empty;
public myDataContext(string connectionString,string Schemaname):base(connectionString)
public override void OnModelCreation(ModelBuilder)
I'm not sure about the inherent evil in the code. Please suggest me if there is any better way to do it
Thanks in advance :)