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
Post a Comment