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