public IActionResult SalvarDisciplinaTurma([FromForm] DisciplinaTurmaModel disciplinaTurmaModel)
        {
            try
            {
                var disciplinaTurmaEntity = _mapper.Map <DisciplinaTurmaModel, DisciplinaTurma>(disciplinaTurmaModel);
                disciplinaTurmaEntity = _disciplinaTurmaService.Inserir(disciplinaTurmaEntity);
            }
            catch (ArgumentException argEx)
            {
                ViewBag.Erro = argEx.Message;
                return(View("VincularDisciplina", disciplinaTurmaModel));
            }
            catch (Exception ex)
            {
                ViewBag.Erro = ex.Message;
            }

            return(RedirectToAction("VisualizarDisciplinas", new { codigoTurma = disciplinaTurmaModel.CodigoDaTurma }));
        }
        public IActionResult VincularDisciplina(int codigoTurma)
        {
            IList <Disciplina> listaDisciplinas = _disciplinaService.Select();

            List <SelectListItem> listItens = new List <SelectListItem>();

            foreach (Disciplina disciplina in listaDisciplinas)
            {
                listItens.Add(new SelectListItem
                {
                    Text  = disciplina.Nome,
                    Value = disciplina.CodigoDisciplina.ToString()
                });
            }

            ViewBag.ListaDisciplinas = listItens;

            DisciplinaTurmaModel disciplinaTurmaModel = new DisciplinaTurmaModel();

            disciplinaTurmaModel.CodigoDaTurma = codigoTurma;

            return(View(disciplinaTurmaModel));
        }