public async Task <IActionResult> Edit(AgendamentoDto dto) { ViewBag.Periodo = Combos.retornarOpcoesPeriodo(); ViewBag.TipoSala = Combos.retornarOpcoesSala(); dto.Validate(); if (dto.Invalid) { TempData["Notificacao"] = new BadRequestDto(dto.Notifications, TipoNotificacao.Warning); return(View(dto)); } await _agendamentoService.EditarAsync(dto); if (_agendamentoService.Invalid) { TempData["Notificacao"] = new BadRequestDto(_agendamentoService.Notifications, TipoNotificacao.Warning); return(View(dto)); } TempData["Notificacao"] = new BadRequestDto(new List <Notification>() { new Notification("EditarAgendamento", "Agendamento Editado com sucesso.") }, TipoNotificacao.Success); ViewBag.Controller = "Agendamentos"; return(View("_Confirmacao")); }