How to convert LINQ query result to List?

前端 未结 5 1443
花落未央
花落未央 2020-12-06 09:51

I need to convert linq query result to list. I tried the following code:

var qry = from a in obj.tbCourses
                    


        
5条回答
  •  -上瘾入骨i
    2020-12-06 10:16

    List = (from c in obj.tbCourses
                     select 
                    new course(c)).toList();
    

    You can convert the entity object to a list directly on the call. There are methods to converting it to different data struct (list, array, dictionary, lookup, or string)

提交回复
热议问题