Linq query error

后端 未结 4 1547
渐次进展
渐次进展 2021-01-06 19:20

I am using following Linq query:

from p in People
 where p.Name == \"George Lucas\"
select p.TitlesActedIn

where TitlesActedIn is a list. P

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-06 19:40

    Interestingly, the following works:

    from p in People
    where p.Name == "George Lucas"
    select new { p.TitlesActedIn }
    

    as does this:

    (from p in People
    where p.Name == "George Lucas"
    select new { p.TitlesActedIn }).First().TitlesActedIn
    

    The WCF client automatically adds the expansion call in the URI translation:

    http://odata.netflix.com/Catalog/People()?$filter=Name eq 'George Lucas'&$top=1&$expand=TitlesActedIn&$select=TitlesActedIn/*
    

提交回复
热议问题