/// <summary> /// Run the middlewares. /// </summary> /// <param name="hubContext">DotNetify hub context.</param> private void RunMiddlewares(IDotNetifyHubContext hubContext) { try { _middlewareFactories?.ToList().ForEach(factory => factory().Invoke(hubContext)); } catch (Exception ex) { Response_VM(Context.ConnectionId, hubContext.VMId, SerializeException(ex)); throw new OperationCanceledException($"Middleware threw {ex.GetType().Name}: {ex.Message}", ex); } }
public void Invoke(IDotNetifyHubContext hubContext) { Trace.WriteLine($"{hubContext.MethodName} {hubContext.VMId}, {JsonConvert.SerializeObject(hubContext.Data)}"); }
public void Invoke(IDotNetifyHubContext hubContext) { Trace.WriteLine(JsonConvert.SerializeObject(hubContext.CallerContext.User)); }