public ActionResult Create(IDtable id) { try { // TODO: Add insert logic here if (ModelState.IsValid) { db.AddToIDtables(id); db.SaveChanges(); return RedirectToAction("Index"); } } catch(Exception ex) { ModelState.AddModelError("Error",ex); } return View(); }
/// <summary> /// Deprecated Method for adding a new object to the IDtables EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToIDtables(IDtable iDtable) { base.AddObject("IDtables", iDtable); }
/// <summary> /// Create a new IDtable object. /// </summary> /// <param name="iDnumber">Initial value of the IDnumber property.</param> /// <param name="firstName">Initial value of the FirstName property.</param> /// <param name="lastName">Initial value of the LastName property.</param> public static IDtable CreateIDtable(global::System.Int32 iDnumber, global::System.String firstName, global::System.String lastName) { IDtable iDtable = new IDtable(); iDtable.IDnumber = iDnumber; iDtable.FirstName = firstName; iDtable.LastName = lastName; return iDtable; }
public ActionResult Create() { IDtable id = new IDtable(); return View(id); }