Exemplo n.º 1
0
        public static IContainer InstantiateSignalRHubs(this IContainer container)
        {
            var hubTypes = HubTypeHelper.GetHubTypes();

            foreach (var hubType in hubTypes)
            {
                container.Resolve(hubType);
            }

            return(container);
        }
Exemplo n.º 2
0
        public static ContainerBuilder RegisterWithSignalR(this ContainerBuilder builder)
        {
            //builder.RegisterHubs(AssemblyHelper.GetReferencedAssemblies().ToArray()); // it creates a new instance on each request

            var hubTypes = HubTypeHelper.GetHubTypes();

            foreach (var hubType in hubTypes)
            {
                RegisterSignalRHub(builder, hubType);
            }

            return(builder);
        }