예제 #1
0
 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);
 }
예제 #2
0
        public ActionResult Create(Resort resort)
        {
            if (ModelState.IsValid)
            {
                db.Resorts.AddObject(resort);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(resort);
        }
예제 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Resorts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToResorts(Resort resort)
 {
     base.AddObject("Resorts", resort);
 }
예제 #4
0
 /// <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;
 }