コード例 #1
0
 public async Task <Response> Handle(Request request)
 {
     return(new Response()
     {
         Dashboard = DashboardApiModel.FromDashboard(await _context.Dashboards
                                                     .Include(x => x.Tenant)
                                                     .Include(x => x.DashboardTiles)
                                                     .Include("DashboardTiles.Tile")
                                                     .SingleAsync(x => x.Id == request.Id && x.Tenant.UniqueId == request.TenantUniqueId))
     });
 }
コード例 #2
0
            public async Task <Response> Handle(Request request)
            {
                var dashboards = await _context.Dashboards
                                 .Include(x => x.Tenant)
                                 .Where(x => x.Tenant.UniqueId == request.TenantUniqueId)
                                 .ToListAsync();

                return(new Response()
                {
                    Dashboards = dashboards.Select(x => DashboardApiModel.FromDashboard(x)).ToList()
                });
            }
コード例 #3
0
            public async Task <Response> Handle(Request request)
            {
                var dashboard = await _context.Dashboards
                                .Include(x => x.Tenant)
                                .Include(x => x.DashboardTiles)
                                .Include("DashboardTiles.Tile")
                                .FirstOrDefaultAsync(x => x.Username == request.Username &&
                                                     x.Tenant.UniqueId == request.TenantUniqueId &&
                                                     x.IsDefault);

                return(new Response()
                {
                    Dashboard = DashboardApiModel.FromDashboard(dashboard)
                });
            }