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

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

                return(Task.FromResult(new Response()
                {
                    DashboardCards = dashboardCards.ToArray()
                }));
            }
 public Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => Task.FromResult(new Response()
 {
     DashboardCard = DashboardCardDto.FromDashboardCard(_eventStore.Query <DashboardCard>(request.DashboardCardId))
 });
Пример #3
0
 public Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => Task.FromResult(new Response()
 {
     DashboardCards = _eventStore.Query <DashboardCard>().Select(x => DashboardCardDto.FromDashboardCard(x)).ToList()
 });