public ActionResult Edit(Sports sports) { if (ModelState.IsValid) { db.SportsSet.Attach(sports); db.ObjectStateManager.ChangeObjectState(sports, EntityState.Modified); db.SaveChanges(); return RedirectToAction("Index"); } return View(sports); }
public ActionResult Create(Sports sports) { if (ModelState.IsValid) { db.SportsSet.AddObject(sports); db.SaveChanges(); return RedirectToAction("Index"); } return View(sports); }
/// <summary> /// Deprecated Method for adding a new object to the SportsSet EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSportsSet(Sports sports) { base.AddObject("SportsSet", sports); }
/// <summary> /// Create a new Sports object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> public static Sports CreateSports(global::System.Int32 id, global::System.String name) { Sports sports = new Sports(); sports.Id = id; sports.Name = name; return sports; }