Example #1
0
        public Event GetEvent(int id)
        {
            var eventEntity = GetExistingEvent(id);

            eventEntity.EventComments = _eventCommentService.GetComments(id);
            eventEntity.Place         = _placeService.GetPlaceLite(eventEntity.PlaceId);
            eventEntity.EventPhotos   = _unitOfWork.EventPhotoRepository.Find(x => x.EventId == id).ToList();

            return(eventEntity);
        }
Example #2
0
        public IActionResult GetComments(int eventId)
        {
            var comments = _eventCommentService.GetComments(eventId).Select(x => new EventCommentViewModel
            {
                Username = x.User.Username,
                Comment  = x.Comment,
                DateTime = x.DateTime
            });

            return(CreateSuccessRequestResult(data: comments));
        }