Пример #1
0
        public async Task <CommandResult> UpdateResourceAsync(UpdateResourceDTO dto)
        {
            var cmd = ToCommandBuilder.MapUpdateResourceCommand(dto);

            var commandResult = await mediator.Send(cmd);

            return(commandResult);
        }
Пример #2
0
 public static UpdateResourceCommand MapUpdateResourceCommand(UpdateResourceDTO dto)
 {
     return(new UpdateResourceCommand()
     {
         Id = dto.Id,
         Amount = dto.Amount,
         Name = dto.Name,
         Observations = dto.Observations
     });
 }
Пример #3
0
        public async Task <IActionResult> Put([FromBody] UpdateResourceDTO resource)
        {
            var result = await _resourceAppService.UpdateResourceAsync(resource);

            return(ApiResponse(result));
        }