當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。