コード例 #1
0
 public int CreateProduct(ProductCreateInput input)
 {
     input.Name = "";
     var product = ObjectMapper.Map<Product>(input);
     return _productRepository.InsertAndGetId(product);
 }
コード例 #2
0
 public void CreateProductAndRollback(ProductCreateInput input)
 {
     _productRepository.Insert(ObjectMapper.Map<Product>(input));
     CurrentUnitOfWork.SaveChanges();
     throw new UserFriendlyException("This exception is thrown to rollback the transaction!");
 }
コード例 #3
0
 public virtual int CreateProduct(ProductCreateInput input)
 {
     return _productRepository.InsertAndGetId(ObjectMapper.Map<Product>(input));
 }