This works:
(from o in Entities.WorkOrderSet
select o)
.Where(MyCustomMethod);
This does not:
(from o in Entities.WorkOrderSet
select o)
.Where(o => MyCustomMethod(o));
([Edit] Even without new
, it doesn't work)
I understand why the second doesn't work - but why in the world does the first work!? Shouldn't I get a "LINQ-to-Entities does not recognize the method..." at runtime, like with the second?
For reference, here is MyCustomMethod
public bool MyCustomMethod(WorkOrder workOrder)
{
return !workOrder.WorkOrderNum.StartsWith("A", StringComparison.CurrentCultureIgnoreCase);
}
Using EF1, not EF4