Example #1
0
 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);
 }
Example #2
0
        public ActionResult Create(students students)
        {
            if (ModelState.IsValid)
            {
                context.students.AddObject(students);
                context.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(students);
        }
Example #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the students EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTostudents(students students)
 {
     base.AddObject("students", students);
 }
Example #4
0
 /// <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);
 }