I have a LINQ function similar to the one below:
public static Func<Contact, bool> activeContactsFilter = c =>
!c.suspended &&
!c.expired &&
(c.status_id == 1 || c.status_id == 7);
This works great when I need to find out which Contacts amongst an IEnumerable
of contacts are "active":
var activeContacts = allContacts.Where(activeContactsFilter);
But what if I want to just check if ONE specific contact is "active"? How do I use this same function for a test on a single object?