Example #1
0
 // Injected thanks to Dependency Injection
 public SyncController(WebServerAgent webServerAgent) => this.webServerAgent = webServerAgent;
 /// <summary>
 /// Get the current client session id
 /// </summary>
 public static string GetClientSessionId(this HttpContext httpContext) => WebServerAgent.TryGetHeaderValue(httpContext.Request.Headers, "dotmim-sync-session-id", out var val) ? val : null;
 /// <summary>
 /// Get the current Step
 /// </summary>
 public static HttpStep GetCurrentStep(this HttpContext httpContext) => WebServerAgent.TryGetHeaderValue(httpContext.Request.Headers, "dotmim-sync-step", out var val) ? (HttpStep)Convert.ToInt32(val) : HttpStep.None;
 /// <summary>
 /// Get Scope Name sent by the client
 /// </summary>
 public static string GetScopeName(this HttpContext httpContext) => WebServerAgent.TryGetHeaderValue(httpContext.Request.Headers, "dotmim-sync-scope-name", out var val) ? val : null;
 /// <summary>
 /// Get Scope Name sent by the client
 /// </summary>
 public static Guid?GetClientScopeId(this HttpContext httpContext) => WebServerAgent.TryGetHeaderValue(httpContext.Request.Headers, "dotmim-sync-scope-id", out var val) ? new Guid(val) : null;
 public static Task WriteHelloAsync(this HttpContext context, WebServerAgent webServerAgent, CancellationToken cancellationToken = default) => webServerAgent.WriteHelloAsync(context, cancellationToken);
 public static Task WriteHelloAsync(this HttpContext context, IEnumerable <WebServerAgent> webServerAgents, CancellationToken cancellationToken = default) => WebServerAgent.WriteHelloAsync(context, webServerAgents, cancellationToken);
 // Injected thanks to Dependency Injection
 public SyncController(WebServerAgent webServerAgent, IWebHostEnvironment env)
 {
     this.webServerAgent = webServerAgent;
     this.env            = env;
 }
Example #9
0
 /// <summary>
 /// Intercept the provider when an http message is downloaded from remote side
 /// </summary>
 public static Guid OnHttpGettingChanges(this WebServerAgent webServerAgent,
                                         Func <HttpGettingClientChangesArgs, Task> action)
 => webServerAgent.RemoteOrchestrator.AddInterceptor(action);
Example #10
0
 /// <summary>
 /// Intercept the provider when an http message is sent
 /// </summary>
 public static Guid OnHttpSendingChanges(this WebServerAgent webServerAgent,
                                         Action <HttpSendingServerChangesArgs> action)
 => webServerAgent.RemoteOrchestrator.AddInterceptor(action);
Example #11
0
 /// <summary>
 /// Intercept the provider when an http response message is sent back to the client
 /// </summary>
 public static Guid OnHttpSendingResponse(this WebServerAgent webServerAgent,
                                          Func <HttpSendingResponseArgs, Task> action)
 => webServerAgent.RemoteOrchestrator.AddInterceptor(action);
Example #12
0
 /// <summary>
 /// Intercept the provider when an http message request from the client arrived to the server
 /// </summary>
 public static Guid OnHttpGettingRequest(this WebServerAgent webServerAgent,
                                         Action <HttpGettingRequestArgs> action)
 => webServerAgent.RemoteOrchestrator.AddInterceptor(action);