public Task <Response> Handle(Request request, CancellationToken cancellationToken)
            {
                var dashboardCards = new List <DashboardCardDto>();

                foreach (var id in request.DashboardCardIds)
                {
                    var dashboardCard = DashboardCardDto.FromDashboardCard(_repository.Query <DashboardCard>(id));
                    dashboardCard.Card = CardDto.FromCard(_repository.Query <Card>(dashboardCard.CardId));
                    dashboardCards.Add(dashboardCard);
                }

                return(Task.FromResult(new Response()
                {
                    DashboardCards = dashboardCards.ToArray()
                }));
            }
Ejemplo n.º 2
0
 public Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => Task.FromResult(new Response()
 {
     DashboardCard = DashboardCardDto.FromDashboardCard(_repository.Query <DashboardCard>().Single(x => x.DashboardCardId == request.DashboardCardId))
 });
 public Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => Task.FromResult(new Response()
 {
     DashboardCards = _repository.Query <DashboardCard>().Select(x => DashboardCardDto.FromDashboardCard(x)).ToList()
 });