Ejemplo n.º 1
0
 public ScopedHubEvent(HubContextWrapper context, string scopeId)
 {
     if (string.IsNullOrWhiteSpace(scopeId))
     {
         throw new ArgumentNullException(nameof(scopeId));
     }
     RaiseAt = DateHelper.Instance.GetDateNow();
     Context = context;
 }
Ejemplo n.º 2
0
        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);
        }