public PetType UpdatePetType(int id, PetType type) { if (!_petTypeRepository.ReadPetTypes().Exists(x => x.PetTypeId.Equals(id))) { throw new KeyNotFoundException("could not update pet type"); } return(_petTypeRepository.UpdatePetType(id, type)); }
public PetType UpdatePetType(PetType type, int ID) { if (GetPetTypeByID(ID) == null) { throw new ArgumentException("No pet type with such ID found"); } if (type == null) { throw new ArgumentException("Updating pet type does not excist"); } type.ID = ID; return(PetTypeRepository.UpdatePetType(type)); }
public bool UpdatePetType(PetType type) { return(_petTypeRepository.UpdatePetType(type)); }
public PetType UpdatePetType(PetType updatePetType) { PetType oldPetType = FindPetTypeById(updatePetType.IdOfPetTypes); return(_petTypeRepo.UpdatePetType(updatePetType, oldPetType)); }
public PetType UpdatePetType(PetType theUpdatedType) { PetType theOldPetType = FindPetTypeById(theUpdatedType.PetTypeId); return(_petTypeRepo.UpdatePetType(theUpdatedType, theOldPetType)); }
public bool UpdatePetType(PetType type) { _validator.PetTypeValidator(type); return(_petTypeRepository.UpdatePetType(type)); }