public IAnimal GetIAnimal() { _getService.Write("Выберите животное:"); _dict.ToList().ForEach(el => _getService.Write($"{el.Key} - {el.Value.ToString()}")); string str = _notifyService.ReadText(); if (!_dict.ContainsKey(str)) { throw new InvalidOperationException("there is no this animal"); } return(_dict[str].GetAnimal()); }