public ActionResult Create() { SubjectManagerViewModel viewModel = new SubjectManagerViewModel(); viewModel.Subject = new Subject(); viewModel.SubjectCategories = categoryContext.Collection(); return(View(viewModel)); }
public ActionResult Edit(string Id) { Subject subjectToEdit = subjectContext.Find(Id); if (subjectToEdit != null) { SubjectManagerViewModel viewModel = new SubjectManagerViewModel(); viewModel.Subject = subjectToEdit; viewModel.SubjectCategories = categoryContext.Collection(); return(View(viewModel)); } else { return(HttpNotFound()); } }