public Task <Feature> FindFeatureAsync(string featureName, string productName, CancellationToken cancellationToken = default)
        {
            _diagnostics.BeginFindFeature(featureName, productName);
            var feature = GetFeatureFromConfiguration(featureName, productName);

            if (feature != null)
            {
                _diagnostics.FeatureExist(featureName, productName);
                return(Task.FromResult(feature.To()));
            }

            _diagnostics.FeatureNotExist(featureName, productName);
            return(Task.FromResult <Feature>(null));
        }
Пример #2
0
        public Task <Feature> FindFeatureAsync(string featureName, string productName, string deploymentName = null, CancellationToken cancellationToken = default)
        {
            _ = featureName ?? throw new ArgumentNullException(featureName);
            _ = productName ?? throw new ArgumentNullException(productName);

            _diagnostics.BeginFindFeature(featureName, productName);

            var feature = GetFeatureFromConfiguration(featureName, productName);

            if (feature != null)
            {
                _diagnostics.FeatureExist(featureName, productName);

                return(Task.FromResult(feature.To()));
            }

            _diagnostics.FeatureNotExist(featureName, productName);

            return(Task.FromResult <Feature>(null));
        }