예제 #1
0
        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));
        }
예제 #2
0
 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));
 }
예제 #3
0
 public bool UpdatePetType(PetType type)
 {
     return(_petTypeRepository.UpdatePetType(type));
 }
예제 #4
0
        public PetType UpdatePetType(PetType updatePetType)
        {
            PetType oldPetType = FindPetTypeById(updatePetType.IdOfPetTypes);

            return(_petTypeRepo.UpdatePetType(updatePetType, oldPetType));
        }
예제 #5
0
        public PetType UpdatePetType(PetType theUpdatedType)
        {
            PetType theOldPetType = FindPetTypeById(theUpdatedType.PetTypeId);

            return(_petTypeRepo.UpdatePetType(theUpdatedType, theOldPetType));
        }
예제 #6
0
 public bool UpdatePetType(PetType type)
 {
     _validator.PetTypeValidator(type);
     return(_petTypeRepository.UpdatePetType(type));
 }