private ActionDescriptorsCollection GetCollection()
        {
            var actionDescriptorProvider = 
                _serviceProvider.GetService<INestedProviderManager<ActionDescriptorProviderContext>>();            
            var actionDescriptorProviderContext = new ActionDescriptorProviderContext();

            actionDescriptorProvider.Invoke(actionDescriptorProviderContext);

            return new ActionDescriptorsCollection(actionDescriptorProviderContext.Results, 0);
        }
Пример #2
0
        private ActionDescriptorsCollection GetCollection()
        {
            var actionDescriptorProvider =
                _serviceProvider.GetService <INestedProviderManager <ActionDescriptorProviderContext> >();
            var actionDescriptorProviderContext = new ActionDescriptorProviderContext();

            actionDescriptorProvider.Invoke(actionDescriptorProviderContext);

            return(new ActionDescriptorsCollection(actionDescriptorProviderContext.Results, 0));
        }
Пример #3
0
        public void Invoke(ActionDescriptorProviderContext context, Action callNext)
        {
            callNext();

            if (context.Results.Count == 0)
            {
                throw new InvalidOperationException("No actions found!");
            }

            Interlocked.Increment(ref _callCount);
        }
        private ActionDescriptorsCollection GetCollection()
        {
            var actionDescriptorProvider =
                _serviceProvider.GetRequiredService <INestedProviderManager <ActionDescriptorProviderContext> >();
            var actionDescriptorProviderContext = new ActionDescriptorProviderContext();

            actionDescriptorProvider.Invoke(actionDescriptorProviderContext);

            if (_logger.IsEnabled(LogLevel.Verbose))
            {
                foreach (var actionDescriptor in actionDescriptorProviderContext.Results)
                {
                    _logger.WriteVerbose(new ActionDescriptorValues(actionDescriptor));
                }
            }

            return(new ActionDescriptorsCollection(actionDescriptorProviderContext.Results, 0));
        }
Пример #5
0
 public void Invoke(ActionDescriptorProviderContext context, Action callNext)
 {
     context.Results.AddRange(GetDescriptors());
     callNext();
 }