public ActionResult Create( users user) { if (!ModelState.IsValid) return View(); // _db.AddTousers(user); _db.AddTousers1(user); _db.SaveChanges(); return RedirectToAction("Index"); }
public ActionResult Delete(users us) { var ou = (from m in _db.users1 where m.id == us.id select m).First(); if (!ModelState.IsValid) return View(ou); _db.ApplyOriginalValues(ou.EntityKey.EntitySetName, us); //_db.ApplyPropertyChanges(ou.EntityKey.EntitySetName, us); _db.SaveChanges(); return RedirectToAction("Index"); }
/// <summary> /// Create a new users object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="first_name">Initial value of the first_name property.</param> /// <param name="lastname">Initial value of the lastname property.</param> public static users Createusers(global::System.Int32 id, global::System.String first_name, global::System.String lastname) { users users = new users(); users.id = id; users.first_name = first_name; users.lastname = lastname; return users; }
/// <summary> /// Deprecated Method for adding a new object to the users1 EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTousers1(users users) { base.AddObject("users1", users); }
/// <summary> /// Deprecated Method for adding a new object to the users1 EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTousers1(users users) { base.AddObject("users1", users); }