예제 #1
0
        public ActionResult Create(Assignment assignment)
        {
            if (ModelState.IsValid)
            {
                ds.Create(assignment);
                return RedirectToAction("Index");
            }

            return View(assignment);
        }
예제 #2
0
 // Method for updating assignments
 public void Update(Assignment assignment)
 {
     dc.Entry(assignment).State = EntityState.Modified;
     dc.SaveChanges();
 }
예제 #3
0
 // Method for creating assignments
 public void Create(Assignment assignment)
 {
     dc.Assignments.Add(assignment);
     dc.SaveChanges();
 }