public async Task <IActionResult> PutAsset(string app, Guid id, [FromBody] AssetUpdateDto request) { var command = SimpleMapper.Map(request, new RenameAsset { AssetId = id }); await CommandBus.PublishAsync(command); return(NoContent()); }
public async Task <IActionResult> UpdateAsset(AssetUpdateDto assetUpdateDto) { try { var asset = _mapper.Map <Asset>(assetUpdateDto); asset.UpdatedAt = DateTime.Now; context.Assets.Update(asset); await context.SaveChangesAsync(); return(Ok()); } catch (Exception ex) { return(BadRequest(ex)); } }
public async Task <IActionResult> PutAsset(string app, Guid id, [FromBody] AssetUpdateDto request) { await CommandBus.PublishAsync(request.ToCommand(id)); return(NoContent()); }