public async Task DeleteAsync(DeleteProcessamentRequestModel requestModel) { var processament = await processamentRepository.GetByUserCPFAsync(requestModel.CPF); switch (processament != null) { case true: { await processamentRepository.DeleteAsync(processament); break; } case false: throw new Exception("The CPF doenst exists."); } }
public async Task <IActionResult> Delete([FromRoute] DeleteProcessamentRequestModel requestModel) { await processamentService.DeleteAsync(requestModel); return(Ok("Processament deleted successfully.")); }