예제 #1
0
        public async Task <IEnumerable <int> > CountResultCode()
        {
            var result = new List <int> {
                0, 0, 0, 0
            };

            var builder400 = Builders <Logging> .Filter.Eq("StatusCode", 400);

            var builder401 = Builders <Logging> .Filter.Eq("StatusCode", 401);

            var builder200 = Builders <Logging> .Filter.Eq("StatusCode", 200);

            result[0] = (await loggingRepository.FindListAsync(builder200)).Count();
            result[1] = (await loggingRepository.FindListAsync(builder400)).Count();
            result[2] = (await loggingRepository.FindListAsync(builder401)).Count();

            result[3] = (int)((await loggingRepository.CountAsync()) - result[0] - result[1] - result[2]);

            return(result);
        }