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 }); }
public void Save(Event item) { repository.Save<Event>(item); }
public void Delete(Event item) { repository.Delete<Event>(item); }