I'm trying to make a query in the table, that its name will come by method scope, but it does not allow me to use Select();
or Where();
System.Type referenceTableType =
System.Type.GetType("MeuProjeto.Model." + typeRequest.ReferenceTable);
object TabelaPraConsulta = Activator.CreateInstance(referenceTableType);
var x= Database.Set(TabelaPraConsulta).Select(qw => qw.id = id); // isso nao é possivel
I'm not really sure how to do this, I've never used reflection .
Then I would like to be able to query the name of the table that comes in typeRequest.ReferenceTable but I do not know how