KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a filter that I use across many methods: Expression<Func<Child, bool>> filter = child => child.Status == 1; (actually is more complex than that) And I have to do the following return db.Parents.Where(parent => parent.Status == 1 && parent.Child.Status == 1); where the condition is the same as in the filter above. I want to reuse the filter in this method. But I don't know how. I tried return db.Parents.Where(parent => parent.Status == 1 && filter(parent.Child)); but an Expression can't be used as a method
Tags (comma-separated)
Save Edits
Cancel