示例#1
0
            public Task <Response> Handle(Request request, CancellationToken cancellationToken)
            {
                var dashboard      = _eventStore.Query <Dashboard>(request.DashboardId);
                var dashboardCards = new List <DashboardCardDto>();

                foreach (var dashboardCardId in dashboard.DashboardCardIds)
                {
                    dashboardCards.Add(DashboardCardDto.FromDashboardCard(_eventStore.Query <DashboardCard>(dashboardCardId)));
                }

                return(Task.FromResult(new Response()
                {
                    Dashboard = DashboardDto.FromDashboard(dashboard, dashboardCards)
                }));
            }
示例#2
0
            public Task <Response> Handle(Request request, CancellationToken cancellationToken)
            {
                var dashboard = _eventStore.Query <Dashboard>("Name", "Default");

                var dashboardDto = DashboardDto.FromDashboard(dashboard);

                var dashboardCardDtos = new List <DashboardCardDto>();

                foreach (var dashboardCardId in dashboard.DashboardCardIds)
                {
                    var dashboardCardDto = DashboardCardDto.FromDashboardCard(_eventStore.Query <DashboardCard>(dashboardCardId));
                    dashboardCardDto.Card = CardDto.FromCard(_eventStore.Query <Card>(dashboardCardDto.CardId));
                    dashboardCardDtos.Add(dashboardCardDto);
                }

                return(Task.FromResult(new Response()
                {
                    Dashboard = DashboardDto.FromDashboard(dashboard, dashboardCardDtos)
                }));
            }
示例#3
0
 public Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => Task.FromResult(new Response()
 {
     Dashboards = _eventStore.Query <Dashboard>().Select(x => DashboardDto.FromDashboard(x)).ToList()
 });