Using lambda delegate Expression> - where my expression takes a Role object (POCO).
Looking to use that POCO Role object and map it to a data layer Role object with matching properties. To do that, I need to be able to get the Role object from the delegate.
Example:
public List<Role> FindAll(Expression<Func<Role, bool>> filter)
Calling this method like:
FindAll(r => r.Name == role.Name);
r is type Role, and within the FindAll function, I can see that filter has one parameter, as such:
Can I extract that object? And how?
I'm sure it MUST be doable, after all, linq does it internally all the time...