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

            return View(course);
        }
예제 #2
0
 // Method for updating courses
 public void Update(Course item)
 {
     dc.Entry(item).State = EntityState.Modified;
     dc.SaveChanges();
 }
예제 #3
0
 // Method for creating courses
 public int Create(Course course)
 {
     dc.Courses.Add(course);
     dc.SaveChanges();
     return course.Id;
 }