Is there a way to dynmaically define the table name so I do not have to do multiple calls if the table I’m accessing is different for different conditions? I don’t want to have an if/else for every table I am accessing if I can use a variable name instead.
using (Entity ctx = new Entity())
{
dbTableVal = "EntityTables";
var query = from d in dbTableVal
where d == "Yes"
select d;
}
I guess no, because the table itself also defines the type of returned
IQueryable<T>. It is even not possible with ESQL (which has string syntax) to define generic query where you don’t know the type of result set.