public IActionResult GetAddCathedra() { AddCathedraModel newModel = new AddCathedraModel(); newModel.newList = faculty.GetAll().Select(a => new SelectListItem { Value = a.facultyName, Text = a.facultyName }).ToList(); return(View("~/Views/EducationalDepartment/Cathedra/AddCathedra.cshtml", newModel)); }
public async Task <IActionResult> AddNewCathedra(AddCathedraModel model) { CathedraDTO newItem = new CathedraDTO() { cathedraName = model.nameCathedra, facultyName = model.nameFaculty, }; await cathedra.Create(newItem); return(RedirectToAction("GetCathedra", "EducationalDepartment")); }