public async Task<ActionResult> Index(EventModel model)
        {
            if (!ModelState.IsValid)
            {
                return View(model);
            }

            var eventEntity = Mapper.Map<Event>(model);
            eventEntity = (model.Id.HasValue) ?
                await _eventManagementService.UpdateEventAsync(eventEntity) :
                await _eventManagementService.CreateEventAsync(eventEntity, User.Identity.GetUserId());

            return RedirectToAction("Index", "Share", new { eventHash = eventEntity.Id.GetUniqueUrlParameter() });
        }
 private async Task PopulateVenueDetails(EventModel eventModel)
 {
     // TODO place id has to be persisted
     var venuesDetails = await _placeService.GetPlacesDetailsAsync(eventModel.Places.Select(p => p.VenueId).ToList());
     eventModel.Places = eventModel.Places.Select(p =>
     {
         var v = venuesDetails.Single(venue => venue.VenueId == p.VenueId);
         v.Id = p.Id;
         return v;
     }).ToList();
 }