public RedirectToRouteResult Delete(Technology technology, string returnUrl) { Technology tech = _efDbContext.Technologies.FirstOrDefault(t => t.TechnologyID == technology.TechnologyID); if (tech != null) { _efDbContext.Technologies.Remove(tech); } _efDbContext.SaveChanges(); return RedirectToAction("Index", new { returnUrl }); }
public ActionResult Update(Technology technology, string returnUrl) { Technology tech = _efDbContext.Technologies.FirstOrDefault(t => t.TechnologyID == technology.TechnologyID); if (tech != null) { tech.TechnologyName = technology.TechnologyName; technology.TechnologyType = technology.TechnologyType; } _efDbContext.SaveChanges(); return RedirectToAction("Index", new { returnUrl }); }
public ActionResult Create(Technology technology, string returnUrl) { Technology tech = new Technology { TechnologyName = technology.TechnologyName, TechnologyType = technology.TechnologyType }; _efDbContext.Technologies.Add(tech); _efDbContext.SaveChanges(); return RedirectToAction("Index", new { returnUrl }); }