Example #1
0
 public IEnumerable <BaseObject> Filter(IEnumerable <BaseObject> items, IFilterKind <BaseObject> type)
 {
     foreach (var product in items)
     {
         if (type.IsSatisfied(product))
         {
             yield return(product);
         }
     }
 }
Example #2
0
 public IEnumerable <Product> Filter(IEnumerable <Product> items, IFilterKind <Product> kind)
 {
     foreach (var product in items)
     {
         if (kind.IsSatisfied(product))
         {
             yield return(product);
         }
     }
 }