Beispiel #1
0
 /// <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);
     }
 }
Beispiel #2
0
 public void Invoke(IDotNetifyHubContext hubContext)
 {
     Trace.WriteLine($"{hubContext.MethodName} {hubContext.VMId}, {JsonConvert.SerializeObject(hubContext.Data)}");
 }
Beispiel #3
0
 public void Invoke(IDotNetifyHubContext hubContext)
 {
     Trace.WriteLine(JsonConvert.SerializeObject(hubContext.CallerContext.User));
 }