コード例 #1
0
        public async Task <SimpleStatisticsModel> Handle(CountiesVisitedRequest message, CancellationToken token)
        {
            var number = await _context.Answers.Select(r => r.CountyCode).Distinct().CountAsync();

            return(new SimpleStatisticsModel
            {
                Label = "Number of Counties visited",
                Value = number.ToString()
            });
        }
コード例 #2
0
        public async Task <SimpleStatisticsModel> Handle(CountiesVisitedRequest message)
        {
            var number = await _context.Raspuns.Select(r => r.CodJudet).Distinct().CountAsync();

            return(new SimpleStatisticsModel
            {
                Label = "Number of Counties visited",
                Value = number.ToString()
            });
        }
コード例 #3
0
        public async Task <SimpleStatisticsModel> Handle(CountiesVisitedRequest message, CancellationToken token)
        {
            var number = await _context.Answers
                         .Include(a => a.Observer)
                         .Where(x => x.Observer.IdNgo != 1)
                         .Where(x => x.Observer.Ngo.IsActive)
                         .Select(r => r.CountyCode)
                         .Distinct()
                         .CountAsync(token);

            return(new SimpleStatisticsModel
            {
                Label = "Number of Counties visited",
                Value = number.ToString()
            });
        }