c# - Select data from anonymous collection -


how can output first query second query.

query 1:

var students = context.students.select(o => new         {             id = o.stdid,             name = o.name         }); 

query 2:

var students = context.database.sqlquery<object/??>("select  stdid id, name name students"); 

you cannot use context.database.sqlquery anonymous type. need define student class (with id, name) , use it.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -