public List <PetType> FindPetTypesByProperty(Filter filter) { IEnumerable <PetType> results; var list = _petTypeRepo.ReadAllPetTypes(); switch (filter.Property) { case "name": results = list.Where(owner => owner.Name.ToLower().Contains(filter.Value)); return(results.ToList()); } return(null); // Should never happen }
public List <Pet> GetPetsByType(string type) { foreach (var petType in _petTypeRepo.ReadAllPetTypes()) { if (!type.Equals(petType.GetType())) { throw new Exception("Please, enter a valid value for the Type"); } } return(_petRepo.GetPetsByType(type)); }
public List <PetType> ReadAllPetTypes() { return(_petTypeRepo.ReadAllPetTypes()); }
public List<PetType> GetAllPetTypes() { return _petTypeRepository.ReadAllPetTypes().ToList(); }