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