Exemple #1
0
        public async Task <int> CreateAsync([FromBody] ChangeProductDto dto)
        {
            var command = new CreateProductCommand {
                Dto = dto
            };
            await _commandDispatcher.SendAsync(command);

            return(command.Id);
        }
Exemple #2
0
 public async Task UpdateAsync(
     int id,
     [FromBody] ChangeProductDto dto,
     [FromServices] IRequestHandler <UpdateProductCommand> handler
     )
 {
     var result = await handler.HandleAsync(new UpdateProductCommand()
     {
         Dto = dto, Id = id
     });
 }
Exemple #3
0
        public async Task <int> CreateAsync(
            [FromBody] ChangeProductDto dto,
            [FromServices] IRequestHandler <CreateProductCommand, int> handler)
        {
            var id = await handler.HandleAsync(new CreateProductCommand()
            {
                Dto = dto
            });

            return(id);
        }
Exemple #4
0
 public Task UpdateAsync(int id, [FromBody] ChangeProductDto dto)
 {
     return(_commandDispatcher.SendAsync(new UpdateProductCommand {
         Id = id, Dto = dto
     }));
 }
Exemple #5
0
 public Task <int> CreateAsync([FromBody] ChangeProductDto dto)
 {
     return(_handlerDispatcher.SendAsync(new CreateProductCommand {
         Dto = dto
     }));
 }
 public async Task UpdateAsync(int id, [FromBody] ChangeProductDto dto)
 {
     await _productService.UpdateEntityAsync(id, dto);
 }
 public async Task <int> CreateAsync([FromBody] ChangeProductDto dto)
 {
     return(await _productService.CreateEntityAsync(dto));
 }
Exemple #8
0
 public Task UpdateAsync(int id, [FromBody] ChangeProductDto dto)
 {
     return(_productService.UpdateAsync(id, dto));
 }
Exemple #9
0
 public Task <int> CreateAsync([FromBody] ChangeProductDto dto)
 {
     return(_productService.CreateAsync(dto));
 }