public ActionResult Create(CreateEventModel model)
 {
     if (ModelState.IsValid){
         service.CreateEvent(model);
         return RedirectToAction("Index");
     }
     return View(model);
 }
Пример #2
0
 public void CreateEvent(CreateEventModel model)
 {
     var newEvent = Event.Create(model.Name);
     repository.Add(newEvent);
     repository.SaveChanges();
 }