Beispiel #1
0
        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"));
        }
Beispiel #2
0
 public void Update(TEvent @event)
 {
     _archive.AddEvent(@event);
     _observer.Update(@event);
 }