public async Task <CommandResult> UpdateResourceAsync(UpdateResourceDTO dto) { var cmd = ToCommandBuilder.MapUpdateResourceCommand(dto); var commandResult = await mediator.Send(cmd); return(commandResult); }
public static UpdateResourceCommand MapUpdateResourceCommand(UpdateResourceDTO dto) { return(new UpdateResourceCommand() { Id = dto.Id, Amount = dto.Amount, Name = dto.Name, Observations = dto.Observations }); }
public async Task <IActionResult> Put([FromBody] UpdateResourceDTO resource) { var result = await _resourceAppService.UpdateResourceAsync(resource); return(ApiResponse(result)); }