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)); }
public void CreateShoe(ShoeModel shoe) { _repository.CreateShoe(ToShoe(shoe)); }