Example #1
0
 private void ValidateProductSize(ProductStock productStock)
 {
     if (productStock.ProductSize == null)
     {
         throw new ArgumentException("You need to specify a ProductSize for the ProductStock.");
     }
     if (_productSizeRepository.Read(productStock.ProductSize.Id) == null)
     {
         throw new ArgumentException($"The ProductSize with the ID: {productStock.ProductSize.Id} doesn't exist.");
     }
 }
 public ProductSize Read(int productSizeId)
 {
     return(_productSizeRepository.Read(productSizeId));
 }