public ActionResult Add(JobTitle newJobTitle) { if (!ModelState.IsValid) return View(newJobTitle); _repository.Add(newJobTitle); return RedirectToAction("Index"); }
public ActionResult Edit(JobTitle title) { if (!ModelState.IsValid) return View(title); _repository.Update(title); return RedirectToAction("Index"); }
public void SetUp() { _dbcontext = new OrgChartDbContext(); _jobTitle = new JobTitle { Description = "test", }; _dbcontext.JobTitles.Add(_jobTitle); _dbcontext.SaveChanges(); }