How do I combine these two methods into one?
public override Expression<Func<Attachment, bool>> MatchingCriteria
{
get { return a => a.Activity.Parent.ActivityUsers.Any(x => (x.User.Id == id)); }
}
and
public override Expression<Func<Attachment, bool>> MatchingCriteria
{
get { return a => a.Activity.ActivityUsers.Any(x => (x.User.Id == id)); }
}
notably, the idea is that I want to check the root record for links to a certain User. But, a may be a root or may be a child (one decendant/level only; not recursive). I want an ORing, so to speak, of these two Linq expressions.
Maybe something like:
Or since you’re only worried about a single level deep you could probably use:
This option is probably more appropriate.