Beispiel #1
0
 [HttpPost, Route("delete")] //, AmigoTenantClaimsAuthorize(ActionCode = ConstantsSecurity.ActionCode.ContractDelete)]
 public async Task <ResponseDTO> Delete(DeleteMainTenantRequest tenant)
 {
     if (ModelState.IsValid)
     {
         return(await _tenantApplicationService.DeleteMainTenantAsync(tenant));
     }
     return(ModelState.ToResponse());
 }
Beispiel #2
0
        public async Task <ResponseDTO> DeleteMainTenantAsync(DeleteMainTenantRequest mainTenant)
        {
            //Map to Command
            var command = _mapper.Map <DeleteMainTenantRequest, DeleteMainTenantCommand>(mainTenant);

            //Execute Command
            var resp = await _bus.SendAsync(command);

            return(ResponseBuilder.Correct(resp));
        }