I have a native sql query which changes dynamically based on user selection.
Code
var sql = "select * from " + temp + ";";
var templist = db.Database.SqlQuery<>(sql).ToList();
The temp variable contains table name which is obtained based on user selection. how can i fetch the records without using entity class in between.sqlquery<>?. Is there any other way to fetch records?.
Note: Dynamic tables are not available in entity model.It is only available in db
Only substitution classes
Read the class factory!