public async Task <int> CreateAsync([FromBody] ChangeProductDto dto) { var command = new CreateProductCommand { Dto = dto }; await _commandDispatcher.SendAsync(command); return(command.Id); }
public async Task UpdateAsync( int id, [FromBody] ChangeProductDto dto, [FromServices] IRequestHandler <UpdateProductCommand> handler ) { var result = await handler.HandleAsync(new UpdateProductCommand() { Dto = dto, Id = id }); }
public async Task <int> CreateAsync( [FromBody] ChangeProductDto dto, [FromServices] IRequestHandler <CreateProductCommand, int> handler) { var id = await handler.HandleAsync(new CreateProductCommand() { Dto = dto }); return(id); }
public Task UpdateAsync(int id, [FromBody] ChangeProductDto dto) { return(_commandDispatcher.SendAsync(new UpdateProductCommand { Id = id, Dto = dto })); }
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)); }
public Task UpdateAsync(int id, [FromBody] ChangeProductDto dto) { return(_productService.UpdateAsync(id, dto)); }
public Task <int> CreateAsync([FromBody] ChangeProductDto dto) { return(_productService.CreateAsync(dto)); }