I am manually creating the equivalent lambda:
var function = p => p.Child.Any(c => c.Field == "value");
I have a MethodInfo reference to the "Any" method used with Expressions built in code.
MethodInfo method = typeof(Queryable).GetMethods()
.Where(m => m.Name == "Any" && m.GetParameters().Length == 2)
.Single().MakeGenericMethod(typeof(Child));
My entities are: Parent 1---* Child
Child is a Navigation Property on Parent (p in the above lambda). The type of the property is EntityCollection as created by the designer.
I was looking for the proper way to reference the Any method to create that call. Marc gave me the answer how to get this here: http://stackoverflow.com/questions/439172/calling-a-method-from-an-expression
But it doesn't work for the entity framework. EntityCollection does not implement IQueryable, so how should the Any method be referenced.