Cannot implicitly convert type IEnumerable to IQueryable

前端 未结 5 2044
一个人的身影
一个人的身影 2021-02-05 07:46

Obfuscated Scenario: A person has zero, one or many pets.

Using Linq to Sql, the need is to get an IQueryable list of pets for the given pe

5条回答
  •  走了就别回头了
    2021-02-05 08:18

    List personPets = 
       (from p in Persons
       where p.ID == somePersonID
       select p.Pets).ToList();
    

    Try something like this.

提交回复
热议问题