public IEnumerable <Product> Filter(IEnumerable <Product> items, BaseSpecification <Product> specification) { foreach (var item in items) { if (specification.IsSutisfied(item)) { yield return(item); } } }
public override bool IsSutisfied(T item) { return(_first.IsSutisfied(item) && _second.IsSutisfied(item)); }