public ActionResult Create([FromForm] EventModel fromBody) { if (ModelState.IsValid) { EventStorage.AddEvent(new Event { Id = Guid.NewGuid(), Name = fromBody.Name, Location = fromBody.Location, Description = fromBody.Description, ContactEmail = fromBody.ContactEmail, Date = Convert.ToDateTime(fromBody.Date) }); } else { return(View("Create", fromBody)); } return(RedirectToAction("Index")); }
public void Update(TEvent @event) { _archive.AddEvent(@event); _observer.Update(@event); }