Exemple #1
0
 public IActionResult Create(EventEditModel model)
 {
     if (ModelState.IsValid)
     {
         var newEvent = new Event();
         newEvent.EventName = model.EventName;
         newEvent.EventType = model.EventType;
         newEvent           = _eventData.Add(newEvent);
         return(RedirectToAction(nameof(Details), new { id = newEvent.EventId }));
     }
     else
     {
         return(View());
     }
 }