本文整理汇总了C#中IAppBuilder.UseSequin方法的典型用法代码示例。如果您正苦于以下问题:C# IAppBuilder.UseSequin方法的具体用法?C# IAppBuilder.UseSequin怎么用?C# IAppBuilder.UseSequin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAppBuilder
的用法示例。
在下文中一共展示了IAppBuilder.UseSequin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Configuration
public void Configuration(IAppBuilder app)
{
// Force sign-in with role
app.Use(new Func<AppFunc, AppFunc>(next => (async env =>
{
var context = new OwinContext(env);
var claims = new List<Claim>
{
new Claim("role", "SomeRole")
};
context.Request.User = new ClaimsPrincipal(new ClaimsIdentity(claims, "SomeAuthType"));
await next.Invoke(env);
})));
app.UseSequin(SequinOptions.Configure()
.WithOwinDefaults()
.WithPipeline(x => new OptOutCommandAuthorization(new OwinIdentityProvider())
{
Next = x.IssueCommand
})
.Build(), new []
{
new ResponseMiddleware(typeof (UnauthorizedCommandResponseMiddleware))
});
}
示例2: Configuration
public void Configuration(IAppBuilder app)
{
var container = ConfigureAutofac();
app.UseSequin(new SequinOptions
{
HandlerFactory = new AutofacHandlerFactory(container)
});
}
示例3: Configuration
public void Configuration(IAppBuilder app)
{
var container = ConfigureAutofac();
app.UseSequin(SequinOptions.Configure()
.WithOwinDefaults()
.WithHandlerFactory(x => new AutofacHandlerFactory(container))
.Build());
}
示例4: Configuration
public void Configuration(IAppBuilder app)
{
app.UseSequin(SequinOptions.Configure()
.WithOwinDefaults()
.WithPipeline(x => new ValidateCommand(new LazyValidatorFactory())
{
Next = x.IssueCommand
})
.Build(), new[]
{
new ResponseMiddleware(typeof(CommandValidationResponseMiddleware), new DefaultDictionaryFormatter())
});
}