Пример #1
0
 public WebNotifyService()
 {
     Instance = this;
     connections.Indexes.Add(WebNotifyConnection.UserInvoker.Instance.Name,
                             new ListIndex <WebNotifyConnection, IUserIdentity>(
                                 WebNotifyConnection.UserInvoker.Instance,
                                 NullUser.Value));
 }
Пример #2
0
        public static IServiceCollection AddWebSocketNotify(this IServiceCollection services, EventHandler <WebNotifyEventArgs> removeHandler = null)
        {
            var service = new WebNotifyService();

            if (removeHandler != null)
            {
                service.RemoveConnection += removeHandler;
            }
            return(services.AddSingleton <IWebNotifyService>(service));
        }