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