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)) }); }
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() }); }
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) }); }