Пример #1
0
            public async Task <Response> Handle(Query request, CancellationToken cancellationToken)
            {
                var budgetIds = _accessControlService.GetAccessibleBudgetIds();

                var data = _readDb.Budgets
                           .Where(x => budgetIds.Contains(x.BudgetId))
                           .ProjectTo <BudgetDto>(_mapperConfiguration)
                           .OrderBy(x => x.Name);

                return(new Response()
                {
                    Data = await data.ToListAsync(cancellationToken),
                    Total = data.Count()
                });
            }