public WebNotifyService() { Instance = this; connections.Indexes.Add(WebNotifyConnection.UserInvoker.Instance.Name, new ListIndex <WebNotifyConnection, IUserIdentity>( WebNotifyConnection.UserInvoker.Instance, NullUser.Value)); }
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)); }