public async Task CancelInsurance(ViewModel.AssignCancelInsuranceRequest request) { await EnsureInsurance(request.InsuranceId); var customer = await _customerRepository.GetCustomerAsync(request.CustomerId); customer.CancelInsurance(request.InsuranceId); await _customerRepository.UnitOfWork.SaveEntitiesAsync(); }
public async Task <IActionResult> CancelInsurance([FromBody] ViewModel.AssignCancelInsuranceRequest request) { await _customerService.CancelInsurance(request); return(Ok()); }