示例#1
0
 public ImpostorMiddleware(
     OwinMiddleware next,
     [NotNull] ImpostorDependencies services,
     [NotNull] ImpostorSettings settings
     ) : base(next)
 {
     if (settings == null)
     {
         throw new NullReferenceException("settings");
     }
     if (services == null)
     {
         throw new NullReferenceException("services");
     }
     _services = services;
     _settings = settings;
     _logger   = services.LoggerFactory(GetType());
 }
示例#2
0
 public static void UseImpostor(this IAppBuilder app, ImpostorSettings settings, ImpostorDependencies dependencies)
 {
     app.Use <ImpostorMiddleware>(dependencies, settings);
 }