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); }
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)); }