c# - convert join LINQ query into list -



c# - convert join LINQ query into list -

i trying convert linq query result list containing join. code given below.

list<studentclass> aa = st in s.students bring together cl in s.classes on st.classid equals cl.classid select new studentclass { stname=st.studentname,clname=cl.classname }; homecoming view(aa);

and model class

public class studentclass { public string stname { get; set; } public string clname { get; set; } }

this throws error. possible solution?

linq query returns ienumerable. needs converted list.

ienumerable<studentclass> aa = st in s.students bring together cl in s.classes on st.classid equals cl.classid select new studentclass { stname=st.studentname,clname=cl.classname }; var list = aa.tolist();

c# asp.net-mvc linq

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -