Ejemplo n.º 1
0
        public async Task <IActionResult> Index()
        {
            ViewBag.Reports = await reportRepository.CountAsync();

            ViewBag.Databases = await databaseGDRRepository.CountAsync();

            ViewBag.Logs = await log.CountAsync();


            return(View());
        }
        public async Task <ReadReportsResponse> Execute(ReadReportsRequest request)
        {
            var averageInstructedSpeedSpecification = new AverageAndInstructedSpeedSpecification();

            var reportsQuery = _reportRepository.Get(averageInstructedSpeedSpecification);

            reportsQuery = reportsQuery.Skip(request.Offset)
                           .Take(request.Limit);

            var totalCount = await _reportRepository.CountAsync(reportsQuery);

            var projectedDataQuery = reportsQuery.Select(ReportsSelectors.ReportSelector);

            var reports = await _reportRepository.ToListAsync(projectedDataQuery);

            return(new ReadReportsResponse
            {
                Reports = new PageModel <Dtos.ReportDto>
                {
                    Items = reports,
                    Total = totalCount
                }
            });
        }