I am trying to create the following dynamically, however I am having problems calling the extension method FirstOrDefault:
using(var context =
Are you sure e.Cars is an IQueryable
If not, you can't pass it to Queryable.FirstOrDefault
If it's an IEnumerable
var result =
Expression.Call(
typeof(Enumerable),
"FirstOrDefault",
new Type[] { TypeSystem.GetElementType(property.Type) },
property);