Пример #1
0
        public ActionResult Create(CreateEventViewModel model)
        {
            Event e = new Event
            {
                Location = new Location { Name = model.LocationName, Slug = model.LocationName.ToSlug() },
                Date = DateTime.UtcNow,
            };

            e.AddParticipants(model.Participants.Select(kvp => new Participant { Name = kvp.Value, Number = kvp.Key }));
            e.Sessions.Add(new Session("Session 1"));
            eventService.Save(e);

            return RedirectToAction("Details", new { id = e.ShortId, slug = e.Location.Slug });
        }
Пример #2
0
 public void Save(Event item)
 {
     repository.Save<Event>(item);
 }
Пример #3
0
 public void Delete(Event item)
 {
     repository.Delete<Event>(item);
 }