Пример #1
0
        public Shoe CreateShoe(Shoe shoeToCreate)
        {
            if (string.IsNullOrEmpty(shoeToCreate.ProductName))
            {
                throw new InvalidDataException("You can NOT create a shoe without a product name.");
            }

            if (shoeToCreate.Price < 0)
            {
                throw new InvalidDataException("The price of a shoe can NOT be less than 0");
            }

            return(shoeRepo.CreateShoe(shoeToCreate));
        }
Пример #2
0
 public void CreateShoe(ShoeModel shoe)
 {
     _repository.CreateShoe(ToShoe(shoe));
 }