public async Task <IActionResult> Create(ConvenioViewModel convenioViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(convenioViewModel));
            }

            if (ResponseHasErrors(await _convenioAppService.Add(convenioViewModel)))
            {
                return(View(convenioViewModel));
            }

            ViewBag.Sucesso = "Convenio registrado!";

            return(View(convenioViewModel));
        }
 public async Task <IActionResult> Post([FromBody] ConvenioViewModel viewModel)
 {
     return(!ModelState.IsValid ?
            CustomResponse(ModelState) :
            CustomResponse(await _convenioAppService.Add(viewModel)));
 }