Esempio n. 1
0
        public Pettype CreateType(Pettype type)
        {
            if (_petTypeRepo.FindPetTypeById(type.Id) == null)
            {
                throw new InvalidDataException("Type not found");
            }

            if (type.TypeName == null)
            {
                throw new InvalidDataException("Type needs a name");
            }
            return(_petTypeRepo.AddType(type));
        }