コード例 #1
0
        public Task <int> Handle(CreateProductAsync input)
        {
            var product = new Product(new CreateProduct
            {
                Name  = input.Name,
                Price = input.Price
            });

            _unitOfWork.Add(product);

            #warning CommitAsync
            _unitOfWork.Commit();
            return(Task.FromResult(product.Id));
        }
コード例 #2
0
 public async Task <IActionResult> CreateAsync(CreateProductAsync command) =>
 await this.ProcessAsync(command);