My current project is using the IDesign architecture, so all of my layers are services. I wanted to have my Read method in the CRUD of my resource access layer take a predicate in the form of a lambda expression as well as a list of related objects to pull. This way the resource access layer will be very generic.
[OperationContract]
Result<MyObject> ReadObjects(Func<MyObject, bool> predicate, string[] includes);
Now I have come to discover something that should have been obvious, and that is that I cannot serialize lambda expressions. I looked into parsing a string into a lambda expression, but that is a no go as well.
Is there any method that I can use to pass a lambda expression to a service? Is there a better way to do what I am trying to do?