I want to get entity from string. Actually I don't know if I'm using correct word for that but if I give you an example probably you will understand what I meant.
For instance, you have blog context and Members, Post, Comments etc models (classes). And client will send you name of the class as a string. But in code behind you need to convert that string to actual class so you can use ef queries to filter.
db.Post.ToList() or db.Post.Where(c => c.Title == "xxx");
But this "Post" is string. So I need to convert it.
Also some people use switch case style functions but I want to write a generic one. So I don't have to change code even if I add or remove tables.
I'm using this code to get dbset but I can't use any query of it.
var type = Assembly.GetExecutingAssembly()
.GetTypes()
.FirstOrDefault(t => t.Name == name);
return dbSet = context.Set(type);