Is it possible to retrieve records from a view that has not been defined in the model and to retrieve his columns value by using column name or ordinal ?
I write this code :
AppContext ctx = new AppContext("name=DbConnString");
string commandText = "SELECT V.ID, V.Code, V.Description FROM vw_UserDefinedView AS V";
ObjectQuery<DbDataRecord> query = new ObjectQuery<DbDataRecord>(commandText, ctx);
but an exception occurred when I try to execute it :
'vw_UserDefinedView' could not be resolved in the current scope or context. Make sure that all referenced variables are in scope, that required schemas are loaded, and that namespaces are referenced correctly. Near simple identifier, line 1, column 43.
Is there a way to accomplish this using Entity Framework and ObjectContext (or DbContext) ?
Best regards, Alberto