当前位置: 首页>>代码示例>>C#>>正文


C# Owin.OwinMiddleware类代码示例

本文整理汇总了C#中Microsoft.Owin.OwinMiddleware的典型用法代码示例。如果您正苦于以下问题:C# OwinMiddleware类的具体用法?C# OwinMiddleware怎么用?C# OwinMiddleware使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OwinMiddleware类属于Microsoft.Owin命名空间,在下文中一共展示了OwinMiddleware类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UrsaHandler

        /// <summary>Initializes a new instance of the <see cref="UrsaHandler"/> class.</summary>
        /// <param name="next">Next middleware in the pipeline.</param>
        /// <param name="requestHandler">The request handler.</param>
        public UrsaHandler(OwinMiddleware next, IRequestHandler<RequestInfo, ResponseInfo> requestHandler) : base(next)
        {
            if (requestHandler == null)
            {
                throw new ArgumentNullException("requestHandler");
            }

            _requestHandler = requestHandler;
        }
开发者ID:alien-mcl,项目名称:URSA,代码行数:12,代码来源:UrsaHandler.cs

示例2: RequestProcTimeMiddleware

 public RequestProcTimeMiddleware(OwinMiddleware next, RequestProcTimeOption requestProcTimeOption = null)
     : base(next)
 {
     _next = next;
     //第一个参数是固定的,后边还可以添加自定义的其它参数
     _requestProcTimeOption = requestProcTimeOption;
 }
开发者ID:a526757124,项目名称:YouTravelProject,代码行数:7,代码来源:RequestProcTimeMiddleware.cs

示例3: RequestLogMiddleware

 public RequestLogMiddleware(OwinMiddleware next, RequestLogOption requestLogOption)
     : base(next)
 {
     _next = next;
     //第一个参数是固定的,后边还可以添加自定义的其它参数
     _requestLogOption = requestLogOption;
 }
开发者ID:a526757124,项目名称:YouTravelProject,代码行数:7,代码来源:RequestLogMiddleware.cs

示例4: ThrottlingMiddleware

        /// <summary>
        /// Initializes a new instance of the <see cref="ThrottlingMiddleware"/> class.
        /// Persists the policy object in cache using <see cref="IPolicyRepository"/> implementation.
        /// The policy object can be updated by <see cref="ThrottleManager"/> at runtime. 
        /// </summary>
        /// <param name="policy">
        /// The policy.
        /// </param>
        /// <param name="policyRepository">
        /// The policy repository.
        /// </param>
        /// <param name="repository">
        /// The repository.
        /// </param>
        /// <param name="logger">
        /// The logger.
        /// </param>
        /// <param name="ipAddressParser">
        /// The IpAddressParser
        /// </param>
        public ThrottlingMiddleware(OwinMiddleware next, 
            ThrottlePolicy policy, 
            IPolicyRepository policyRepository, 
            IThrottleRepository repository, 
            IThrottleLogger logger,
            IIpAddressParser ipAddressParser)
            : base(next)
        {
            core = new ThrottlingCore();
            core.Repository = repository;
            Repository = repository;
            Logger = logger;

            if (ipAddressParser != null)
            {
                core.IpAddressParser = ipAddressParser;
            }

            QuotaExceededResponseCode = (HttpStatusCode)429;

            this.policy = policy;
            this.policyRepository = policyRepository;

            if (policyRepository != null)
            {
                policyRepository.Save(ThrottleManager.GetPolicyKey(), policy);
            }
        }
开发者ID:boro2g,项目名称:WebApiThrottle,代码行数:48,代码来源:ThrottlingMiddleware.cs

示例5: ForceSslWhenAuthenticatedMiddleware

 public ForceSslWhenAuthenticatedMiddleware(OwinMiddleware next, IAppBuilder app, string cookieName, int sslPort)
     : base(next)
 {
     CookieName = cookieName;
     SslPort = sslPort;
     _logger = app.CreateLogger<ForceSslWhenAuthenticatedMiddleware>();
 }
开发者ID:henrycomein,项目名称:NuGetGallery,代码行数:7,代码来源:ForceSslWhenAuthenticatedMiddleware.cs

示例6: RequestLogMiddleware

 public RequestLogMiddleware(OwinMiddleware next, Action<string> requestLogProceAction)
     : base(next)
 {
     _next = next;
     //第一个参数是固定的,后边还可以添加自定义的其它参数
     _requestLogProceAction = requestLogProceAction;
 }
开发者ID:a526757124,项目名称:YCTYProject,代码行数:7,代码来源:RequestLogMiddleware.cs

示例7: KittenStatusCodeMiddleware

 public KittenStatusCodeMiddleware(OwinMiddleware next, KittenStatusCodeOptions options)
     : base(next)
 {
     this.options = options;
     links = new Dictionary<int, string>();
     GenerateLinks();
 }
开发者ID:Tratcher,项目名称:Owin-Dogfood,代码行数:7,代码来源:KittenStatusCodeMiddleware.cs

示例8: ConsulateMiddleware

 public ConsulateMiddleware(OwinMiddleware next, Uri consulBase) : base(next) {
     _consulBase = consulBase;
     _consulClient = new HttpClient(new TracingHandler(new HttpClientHandler()))
     {
         BaseAddress = consulBase
     };
 }
开发者ID:jango2015,项目名称:Consulate,代码行数:7,代码来源:ConsulateMiddleware.cs

示例9: PassThroughMiddleware

 public PassThroughMiddleware(OwinMiddleware next, string p1, int p2, object p3)
     : base(next)
 {
     this.p1 = p1;
     this.p2 = p2;
     this.p3 = p3;
 }
开发者ID:Xamarui,项目名称:Katana,代码行数:7,代码来源:OwinMiddlewareFacts.cs

示例10: RequestTrackingMiddleware

 public RequestTrackingMiddleware(OwinMiddleware next, TelemetryConfiguration telemetryConfiguration) 
     : base(next)
 {
     _telemetryClient = telemetryConfiguration == null 
         ? new TelemetryClient()
         : new TelemetryClient(telemetryConfiguration);
 }
开发者ID:NuGet,项目名称:NuGet.Services.Metadata,代码行数:7,代码来源:RequestTrackingMiddleware.cs

示例11: SwaggerMiddleware

 /// <summary>Initializes a new instance of the <see cref="SwaggerMiddleware"/> class.</summary>
 /// <param name="next">The next middleware.</param>
 /// <param name="path">The path.</param>
 /// <param name="controllerTypes">The controller types.</param>
 /// <param name="settings">The settings.</param>
 /// <param name="schemaGenerator">The schema generator.</param>
 public SwaggerMiddleware(OwinMiddleware next, string path, IEnumerable<Type> controllerTypes, SwaggerOwinSettings settings, SwaggerJsonSchemaGenerator schemaGenerator)
     : base(next)
 {
     _path = path;
     _controllerTypes = controllerTypes;
     _settings = settings;
     _schemaGenerator = schemaGenerator;
 }
开发者ID:NSwag,项目名称:NSwag,代码行数:14,代码来源:SwaggerMiddleware.cs

示例12: HttpCorrelator

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="next">The next piece of OWIN middleware to invoke</param>
 /// <param name="httpCorrelationHeaderKey">The name of the header to use for the correlation ID</param>
 public HttpCorrelator(OwinMiddleware next, string httpCorrelationHeaderKey) : base(next)
 {
     _httpCorrelationHeaderKey = httpCorrelationHeaderKey;
     if (string.IsNullOrWhiteSpace(httpCorrelationHeaderKey))
     {
         throw new ArgumentException("A correlation header name must be provided", nameof(httpCorrelationHeaderKey));
     }
 }
开发者ID:gorkar,项目名称:AccidentalFish.ApplicationSupport.Owin,代码行数:13,代码来源:HttpCorrelator.cs

示例13: PersistentConnectionMiddleware

 public PersistentConnectionMiddleware(OwinMiddleware next,
                                       Type connectionType,
                                       ConnectionConfiguration configuration)
     : base(next)
 {
     _connectionType = connectionType;
     _configuration = configuration;
 }
开发者ID:Choulla-Naresh8264,项目名称:SignalR,代码行数:8,代码来源:PersistentConnectionMiddleware.cs

示例14: Init

 public void Init()
 {
     _fixture = new Fixture().Customize(new AutoRhinoMockCustomization());
     _nextMiddleware = MockRepository.GenerateMock<OwinMiddleware>(new FakeRootMiddelware());
     _handlerPool = new ThermometerRouteHandlerPool();
     
     _sut = new QuestionRouteMiddleware(_nextMiddleware, _handlerPool);
 }
开发者ID:chenghuang-mdsol,项目名称:Medidata.Cloud.Thermometer,代码行数:8,代码来源:QuestionRouteMiddlewareTests.cs

示例15: ResourceMiddleware

 public ResourceMiddleware(OwinMiddleware next) : base(next)
 {
     resourceWebRequestFactory = new ResourceWebRequestFactory();
     resourceWebRequestFactory.PluginAliasMap = base.pluginAliasDict;
     resourceWebRequestFactory.AssemblyMap = new Dictionary<String, Assembly>();
     //注册resource:前缀URI处理程序
     WebRequest.RegisterPrefix("resource:", resourceWebRequestFactory);
 }
开发者ID:aaasoft,项目名称:Quick.OwinMVC,代码行数:8,代码来源:ResourceMiddleware.cs


注:本文中的Microsoft.Owin.OwinMiddleware类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。