示例#1
0
 [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());
 }
示例#2
0
        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);
        }