public ScopedHubEvent(HubContextWrapper context, string scopeId) { if (string.IsNullOrWhiteSpace(scopeId)) { throw new ArgumentNullException(nameof(scopeId)); } RaiseAt = DateHelper.Instance.GetDateNow(); Context = context; }
public static HubContextWrapper <THub> AsHubContextWrapper <THub>(this IHubContext <THub> context) where THub : Hub { if (context == null) { throw new ArgumentNullException(nameof(context)); } var hubContext = new HubContextWrapper <THub>(); hubContext.Clients = context.Clients; hubContext.Groups = context.Groups; hubContext.HubContext = context; return(hubContext); }