/// <summary>
 /// Create a new Device object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="mAC">Initial value of the MAC property.</param>
 /// <param name="remark">Initial value of the Remark property.</param>
 public static Device CreateDevice(global::System.Int32 id, global::System.String name, global::System.String mAC, global::System.String remark)
 {
     Device device = new Device();
     device.Id = id;
     device.Name = name;
     device.MAC = mAC;
     device.Remark = remark;
     return device;
 }
 public ActionResult EditDevice(Device device)
 {
     var d = DBContext.Device.Where(e => e.Id == device.Id).SingleOrDefault();
     d.MAC = device.MAC;
     d.Name = device.Name;
     d.Remark = device.Remark;
     DBContext.SaveChanges();
     return RedirectToAction("IndexDevice");
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Device EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToDevice(Device device)
 {
     base.AddObject("Device", device);
 }
 public ActionResult AddDevice(Device device)
 {
     DBContext.Device.AddObject(device);
     DBContext.SaveChanges();
     return RedirectToAction("IndexDevice");
 }