[HttpPost, Route("update")] //, AmigoTenantClaimsAuthorize(ActionCode = ConstantsSecurity.ActionCode.TenantUpdate)] public async Task <ResponseDTO> Update(UpdateMainTenantRequest tenant) { if (ModelState.IsValid) { return(await _tenantApplicationService.UpdateMainTenantAsync(tenant)); } return(ModelState.ToResponse()); }
public async Task <ResponseDTO> UpdateMainTenantAsync(UpdateMainTenantRequest mainTenant) { //Map to Command var command = _mapper.Map <UpdateMainTenantRequest, UpdateMainTenantCommand>(mainTenant); //Execute Command var resp = await _bus.SendAsync(command); var response = ResponseBuilder.Correct(resp); return(response); }