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

Php operator `break` doesn't stop while -

ubuntu - Bash Script to Check That Files Are Being Created -

vim: Search & replace -