public IEnumerable <T> FindAll(Requiem requiements) { foreach (T item in this) { if (requiements(item)) { yield return(item); } } }
public IEnumerable <T> Find(Requiem requiements) { foreach (T item in this) { if (requiements(item)) { yield return(item); yield break; } } throw new Exception("Collection doesn't have any item that match this requiement"); }
public IEnumerable Find(Requiem requiements) { foreach (Product item in this) { if (requiements(item)) { yield return(item); yield break; } } throw new Exception("Collaction hasn`t any item that match this requiement"); }