Microsoft.AspNet.SignalR.Hubs.DefaultHubManager.GetHubMethods C# (CSharp) Метод

GetHubMethods() публичный Метод

public GetHubMethods ( string hubName, bool>.Func predicate ) : IEnumerable
hubName string
predicate bool>.Func
Результат IEnumerable
        public IEnumerable<MethodDescriptor> GetHubMethods(string hubName, Func<MethodDescriptor, bool> predicate)
        {
            HubDescriptor hub = GetHub(hubName);

            if (hub == null)
            {
                return null;
            }

            var methods = _methodProviders.SelectMany(p => p.GetMethods(hub));

            if (predicate != null)
            {
                return methods.Where(predicate);
            }

            return methods;

        }

Usage Example

Пример #1
0
        public void GetValidHubMethodsWithInvalidPredicate()
        {
            var resolver = new DefaultDependencyResolver();
            var hubManager = new DefaultHubManager(resolver);
            var methodDescriptors = hubManager.GetHubMethods("CoreTestHubWithMethod", descriptor => descriptor.Name == "______AddNumbers______");

            // Still have an ienumerable sequence
            Assert.NotNull(methodDescriptors);
            // But there's nothing in the ienumerable
            Assert.Empty(methodDescriptors);
        }
All Usage Examples Of Microsoft.AspNet.SignalR.Hubs.DefaultHubManager::GetHubMethods