Can I use the LINQ extension method in an ASP.NET data binding expression?
Inside a GridView bound to the Customer collection, which in turn has a collection of phones associated with it, the following Eval expression fails:
<%# Eval("Phones.Single(p => p.PhoneTypeId == 2)") %>
The error message I get is: "First (p => p" is not a valid indexed expression
Is it possible to use LINQ extension operations in a binding expression?
source share