Example #1
0
        public static IContainer InstantiateSignalRHubs(this IContainer container)
        {
            var hubTypes = HubTypeHelper.GetHubTypes();

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

            return(container);
        }
Example #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);
        }