public IActionResult GetInterestPointById(int idInterestPoint)
        {
            InterestPointWithVote interestPointWithVote = Context.InterestPoint
                                                          .Include(a => a.Description)
                                                          .ThenInclude(a => a.VoteDescription)
                                                          .Include(a => a.VoteInterestPoint)
                                                          .Include(a => a.IdUserNavigation)
                                                          .Where(a => a.IdInterestPoint == idInterestPoint)
                                                          .Select(ip => new InterestPointWithVote()
            {
                InterestPoint = ip,
                Average       = calculateAverage(ip)
            })
                                                          .SingleOrDefault();

            if (interestPointWithVote == null)
            {
                return(NotFound());
            }

            return(Ok(interestPointWithVote));
        }
Example #2
0
 public void OnNavigatedTo(NavigationEventArgs e)
 {
     SelectedInterestPoint = (InterestPointWithVote)e.Parameter;
     GetAllDescriptionsByServiceAsync();
 }