How can I build the following LINQ query with the Dynamic Linq library (System.Linq.Dynamic)?
var roles = rolesCollection.Where(r => r.AssignedUsers.Where(u => u.Name.FirstName == "Patrick").Count() > 0);
rolesCollection and AssignedUsers are collections which implement the IEnumerable interface.
I was thinking about doing something like this:
rolesCollection.Where("AssignedUsers.Where(\"Name.FirstName == 'Patrick'\").Count() > 0");
But that doesn't work. A ParseException with the message "No applicable aggregate method 'Where' exists" is thrown.
Thanks in advance.