Example #1
0
 public T GetByName(string name)
 {
     return
         (ListOfAnimals.FirstOrDefault(
              h => string.Compare(h.Name, name,
                                  StringComparison.InvariantCultureIgnoreCase) == 0));
 }
Example #2
0
            public T Remove(T animal)
            {
                var element = ListOfAnimals.FirstOrDefault(h => h == animal);

                if (element != null)
                {
                    ListOfAnimals.Remove(element);
                    return(element);
                }
                throw new NullReferenceException("В экземпляре объекта не задана ссылка на объект!");
            }