I have this Query :
return (from r in this.Requests where r.Status == "Authorised" from i in r.Items select i).Sum(i => i.Value);
I tried converting it to lambda as I prefer that now, so I did :
var sum = Requests.Where(x=>x.Status == "Authorised").Select(x=>x.Items).Sum(x=>x.Value); –> and here I got no Value Item, any ideas why?
You need
SelectManyinstead ofSelect. Your query is basically equivalent to:Note that your original query would have been clearer on multiple lines too…