string tableName = "TblStudents";
Dictionary<string, Type> myDictionary = new Dictionary<string, Type>()
{
{ "TblStudents", typeof(TblStudent) },
{ "TblTeachers", typeof(TblTeacher) }
};
// Context always same
DBContext dbContext = new DBContext();
DbSet dbSet = dbContext.Set(myDictionary[tableName]);
Above code is from this post where I can DbSet dynamically. How can I make this work in Entity Framework Core?
I get an error at
DbSet dbSet = dbContext.Set(myDictionary[tableName]);
seems like Set method has been changed in the new version.
Help is appreciated.