i have a UI page which contains, a drop down, with multiple values.
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. That means in future we may get more number of schema each with the same Oracle database and table structure.
Entity context already created using DB First approach with default config. but based on above requirement, I need to connect to Oracle DB based on Schema change.
While I use below didn't worked for me, It always point to the schema configured at connection string, not the schema that i'm sending to entity context.
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
if (SchemaName != null)
{
modelBuilder.HasDefaultSchema(SchemaName);
}
base.OnModelCreating(modelBuilder);
throw new UnintentionalCodeFirstException();
}
can anybody suggest best way to do it?
I tried by applying schema name at model creation as above code This didn't work for me.
Actual need is, Entity context already created using DB First approach with default config. but based on above requirement, I need to connect to Oracle DB based on Schema change.