Exemple #1
0
 public OpcMiddleware(RequestDelegate next, IOptions <OpcPointOptions> options,
                      IConfiguration configuration, IHubContext <OpcHub, IOpcClient> hubContext)
 {
     if (options == null)
     {
         throw new ArgumentNullException("options");
     }
     this._next          = next ?? throw new ArgumentNullException("next");
     this._options       = options.Value;
     this._configuration = configuration ?? throw new ArgumentNullException("configuration");
     this._hubContext    = hubContext ?? throw new ArgumentNullException("hubContext");
 }
 public static void UseOpcNotification(this IApplicationBuilder app, OpcPointOptions options)
 {
     if (app == null)
     {
         throw new ArgumentNullException("app");
     }
     if (options == null)
     {
         throw new ArgumentNullException("options");
     }
     app.UseMiddleware <OpcMiddleware>(Options.Create(options));
 }