Beispiel #1
0
 [HttpPost, Route("delete")]  //, AmigoTenantClaimsAuthorize(ActionCode = ConstantsSecurity.ActionCode.RentalApplicationDelete)]
 public async Task <ResponseDTO> Delete(RentalApplicationDeleteRequest rentalApplication)
 {
     if (ModelState.IsValid)
     {
         return(await _rentalApplicationApplicationService.DeleteRentalApplicationAsync(rentalApplication));
     }
     return(ModelState.ToResponse());
 }
        public async Task <ResponseDTO> DeleteRentalApplicationAsync(RentalApplicationDeleteRequest rentalApplication)
        {
            //Map to Command
            var command = _mapper.Map <RentalApplicationDeleteRequest, RentalApplicationDeleteCommand>(rentalApplication);

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

            return(ResponseBuilder.Correct(resp));
        }