public async Task <ShellDescriptor> GetShellDescriptorAsync() { // Prevent multiple queries during the same request if (_shellDescriptor == null) { _shellDescriptor = await _session.Query <ShellDescriptor>().FirstOrDefaultAsync(); if (_shellDescriptor != null) { var configuredFeatures = new ConfiguredFeatures(); _shellConfiguration.Bind(configuredFeatures); var features = _alwaysEnabledFeatures.Concat(configuredFeatures.Features .Select(id => new ShellFeature(id) { AlwaysEnabled = true })).Distinct(); _shellDescriptor.Features = features .Concat(_shellDescriptor.Features) .Distinct() .ToList(); } } return(_shellDescriptor); }
public async Task <ShellDescriptor> GetShellDescriptorAsync() { // Prevent multiple queries during the same request if (_shellDescriptor == null) { _shellDescriptor = await _session.Query <ShellDescriptor>().FirstOrDefaultAsync(); if (_shellDescriptor != null) { var configuredFeatures = new ConfiguredFeatures(); _shellConfiguration.Bind(configuredFeatures); var features = _alwaysEnabledFeatures .Concat(configuredFeatures.Features.Select(id => new ShellFeature(id) { AlwaysEnabled = true })) .Concat(_shellDescriptor.Features) .Distinct(); var featureIds = features.Select(sf => sf.Id).ToArray(); var missingDependencies = (await _extensionManager.LoadFeaturesAsync(featureIds)) .Select(entry => entry.FeatureInfo.Id) .Except(featureIds) .Select(id => new ShellFeature(id)); _shellDescriptor.Features = features .Concat(missingDependencies) .ToList(); } } return(_shellDescriptor); }
public async Task <ShellDescriptor> GetShellDescriptorAsync() { if (_shellDescriptor == null) { var configuredFeatures = new ConfiguredFeatures(); _shellConfiguration.Bind(configuredFeatures); var features = _alwaysEnabledFeatures .Concat(configuredFeatures.Features.Select(id => new ShellFeature(id) { AlwaysEnabled = true })) .Distinct(); var featureIds = features.Select(sf => sf.Id).ToArray(); var missingDependencies = (await _extensionManager.LoadFeaturesAsync(featureIds)) .Select(entry => entry.FeatureInfo.Id) .Except(featureIds) .Select(id => new ShellFeature(id)); _shellDescriptor = new ShellDescriptor { Features = features .Concat(missingDependencies) .ToList() }; } return(_shellDescriptor); }
public Task <ShellDescriptor> GetShellDescriptorAsync() { if (_shellDescriptor == null) { var configuredFeatures = new ConfiguredFeatures(); _shellConfiguration.Bind(configuredFeatures); var features = _alwaysEnabledFeatures.Concat(configuredFeatures.Features .Select(id => new ShellFeature(id) { AlwaysEnabled = true })).Distinct(); _shellDescriptor = new ShellDescriptor { Features = features.ToList() }; } return(Task.FromResult(_shellDescriptor)); }