public ActionResult Edit(students students) { if (ModelState.IsValid) { context.students.Attach(students); context.ObjectStateManager.ChangeObjectState(students, EntityState.Modified); context.SaveChanges(); return RedirectToAction("Index"); } return View(students); }
public ActionResult Create(students students) { if (ModelState.IsValid) { context.students.AddObject(students); context.SaveChanges(); return RedirectToAction("Index"); } return View(students); }
/// <summary> /// Deprecated Method for adding a new object to the students EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTostudents(students students) { base.AddObject("students", students); }
/// <summary> /// Create a new students object. /// </summary> /// <param name="studentID">Initial value of the StudentID property.</param> public static students Createstudents(global::System.Int32 studentID) { students students = new students(); students.StudentID = studentID; return students; }
public void Delete(students entity) { Repository.Delete(entity); }
public void Add(students entity) { Repository.Add(entity); }