public IHttpActionResult classForm(int Id) { List <Student> result = new List <Student>(); var ClassRepository = ClassRepositoryFactory.GetRepository(); var StudentRepo = StudentRepositoryFactory.GetRepository(); result = StudentRepo.GetAllByClass(Id); return(Ok(result)); }
public ActionResult index(ClassViewModel viewModel) { Student student = new Student(); student.StudentName = viewModel.StudentName; student.ClassId = viewModel.Id; StudentRepositoryFactory.GetRepository().Add(student); return(RedirectToAction("Index", "Home")); }