Exemple #1
0
 public ActionResult Create(Course course)
 {
     if (!ModelState.IsValid)
     {
         return(View(course));
     }
     course.UserId = User.Identity.GetUserId();
     db.AddCourse(course);
     return(RedirectToAction("Index"));
 }