I am trying to convert a Linq query that I worked in Linq to be able to work in dynamic linq (using System.Linq.Dynamic), because I want the user to be able to create their own queries and this query string will be added to other query strings at runtime.
I have a request:
db.incidents.Where(a => a.incidentLocations.Single().location.street.Contains(location);
and I tried converting it to the following dynamic linq line:
query =
string.Concat("incidentLocations.Single().location.street.Contains(\"", location, "\")");
db.incidents.Where(query);
Where location is a string that contains search text.
I managed to convert all my other queries to dynamic linq, but this one I am struggling with an exception error:
"No applicable aggregate method" Single "exists"
, linq , - , .