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