public ActionResult Create(FormCollection collection) { try { Professor professor = new Professor(); professor.Nome = collection["Nome"]; professor.Cpf = collection["Cpf"]; professor.DataNascimento = Convert.ToDateTime(collection["DataNascimento"]); professor.Email = collection["Email"]; professor.Endereco = collection["Endereco"]; professor.Telefone = collection["Telefone"]; professor.Identidade = collection["Identidade"]; professor.Matricula = collection["Matricula"]; professor.TitulacaoMaxima = Convert.ToInt32(collection["TitulacaoMaxima"]); ProfessorDAO.Persistir(professor); return(RedirectToAction("Index")); } catch { return(View()); } }