public IEnumerable <Employee> Filter(IEnumerable <Employee> items, ICriteria <Employee> criteria) { foreach (var i in items) { if (criteria.IsAccepted(i)) { yield return(i); } } }
public bool IsAccepted(T t) { return(first.IsAccepted(t) && second.IsAccepted(t)); }