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