public async Task <ActionResult> Index(string eventHash) { if (eventHash == null) { return(View("Index", GetDefaultModel())); } Guid id; try { id = _eventManagementService.GetEventId(eventHash); } catch (FormatException e) { throw new System.Web.HttpException(500, "Invalid event hash", e); } if (await _userService.IsEventEditableFor(id, User.Identity.GetUserId())) { var model = await GetModel(id); if (model != null) { return(View("Index", model)); } } throw new System.Web.HttpException(401, "Unauthorized access."); }
public async Task <ActionResult> Index(string eventHash) { Guid id; try { id = _eventManagementService.GetEventId(eventHash); } catch (FormatException e) { throw new System.Web.HttpException(500, "Invalid event hash", e); } var eventViewmodel = await ConstructEventViewModel(id); if (eventViewmodel == null) { throw new System.Web.HttpException(500, "Invalid event hash"); } return(View("Index", eventViewmodel)); }