How to convert LINQ query result to List?

前端 未结 5 1457
花落未央
花落未央 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条回答
  •  余生分开走
    2020-12-06 10:10

    No need to do so much works..

    var query = from c in obj.tbCourses
            where ...
            select c;
    

    Then you can use:

    List list_course= query.ToList();
    

    It works fine for me.

提交回复
热议问题