本文整理汇总了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;
}
示例2: RequestProcTimeMiddleware
public RequestProcTimeMiddleware(OwinMiddleware next, RequestProcTimeOption requestProcTimeOption = null)
: base(next)
{
_next = next;
//第一个参数是固定的,后边还可以添加自定义的其它参数
_requestProcTimeOption = requestProcTimeOption;
}
示例3: RequestLogMiddleware
public RequestLogMiddleware(OwinMiddleware next, RequestLogOption requestLogOption)
: base(next)
{
_next = next;
//第一个参数是固定的,后边还可以添加自定义的其它参数
_requestLogOption = requestLogOption;
}
示例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);
}
}
示例5: ForceSslWhenAuthenticatedMiddleware
public ForceSslWhenAuthenticatedMiddleware(OwinMiddleware next, IAppBuilder app, string cookieName, int sslPort)
: base(next)
{
CookieName = cookieName;
SslPort = sslPort;
_logger = app.CreateLogger<ForceSslWhenAuthenticatedMiddleware>();
}
示例6: RequestLogMiddleware
public RequestLogMiddleware(OwinMiddleware next, Action<string> requestLogProceAction)
: base(next)
{
_next = next;
//第一个参数是固定的,后边还可以添加自定义的其它参数
_requestLogProceAction = requestLogProceAction;
}
示例7: KittenStatusCodeMiddleware
public KittenStatusCodeMiddleware(OwinMiddleware next, KittenStatusCodeOptions options)
: base(next)
{
this.options = options;
links = new Dictionary<int, string>();
GenerateLinks();
}
示例8: ConsulateMiddleware
public ConsulateMiddleware(OwinMiddleware next, Uri consulBase) : base(next) {
_consulBase = consulBase;
_consulClient = new HttpClient(new TracingHandler(new HttpClientHandler()))
{
BaseAddress = consulBase
};
}
示例9: PassThroughMiddleware
public PassThroughMiddleware(OwinMiddleware next, string p1, int p2, object p3)
: base(next)
{
this.p1 = p1;
this.p2 = p2;
this.p3 = p3;
}
示例10: RequestTrackingMiddleware
public RequestTrackingMiddleware(OwinMiddleware next, TelemetryConfiguration telemetryConfiguration)
: base(next)
{
_telemetryClient = telemetryConfiguration == null
? new TelemetryClient()
: new TelemetryClient(telemetryConfiguration);
}
示例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;
}
示例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));
}
}
示例13: PersistentConnectionMiddleware
public PersistentConnectionMiddleware(OwinMiddleware next,
Type connectionType,
ConnectionConfiguration configuration)
: base(next)
{
_connectionType = connectionType;
_configuration = configuration;
}
示例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);
}
示例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);
}