public ShowEvent(EventModel newEvent, bool ShowTopBar) { var vm = new ShowEventViewModel(newEvent, ShowTopBar); vm.Navigation = Navigation; BindingContext = vm; InitializeComponent(); }
public ViewResult Show(int id) { var model = new ShowEventViewModel() { Event = _eventService.GetEventById(id), Liked = _likeService.IsLiked(id, _userManager.GetUserId(User)) }; return(View(model)); }
public async Task <IActionResult> AddComment(int id, ShowEventViewModel model) { _commentRepository.Create(new Comment() { Content = model.Comment, EventId = id, UserId = _userManager.GetUserId(User) }); return(RedirectToAction("Show", new RouteValueDictionary ( new { controller = "Events", action = "Show", id } ))); }
public List <ShowEventViewModel> GetShowEventViewModelList() { var userId = _authInfrastructure.GetCurrentUserId(); var eventList = _eventsRepository.GetCurrentUserEventList(userId); var showEventViewModelList = eventList.Select(x => { ShowEventViewModel showEventViewModel = _mappingInfrastructure.MapEventToShowEventFormViewModel(x); return(showEventViewModel); }).ToList(); return(showEventViewModelList); }