本文整理汇总了C#中IKernel.BindHttpFilter方法的典型用法代码示例。如果您正苦于以下问题:C# IKernel.BindHttpFilter方法的具体用法?C# IKernel.BindHttpFilter怎么用?C# IKernel.BindHttpFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IKernel
的用法示例。
在下文中一共展示了IKernel.BindHttpFilter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterServices
/// <summary>
/// Загрузка модулей Ninject и регистрация сервисов.
/// </summary>
/// <param name="kernel">Ядро Ninject.</param>
private static void RegisterServices(IKernel kernel)
{
kernel.Bind<IUserRepository>().To<MongoUserRepository>().InSingletonScope();
kernel.Bind<IRevisionRepository>().To<MongoRevisionRepository>().InSingletonScope();
kernel.Bind<IMongoDatabase>().ToMethod(c=>MongoHelper.GetMongoDb()).InSingletonScope();
kernel.BindHttpFilter<BasicAuthenticationFilter>(FilterScope.Controller).WhenControllerHas<BasicAuthenticationAttribute>();
kernel.BindHttpFilter<KnownExceptionFilterAttribute>(FilterScope.Controller);
kernel.BindHttpFilter<RewriteResponseCodeFilterAttribute>(FilterScope.Controller);
}
示例2: RegisterServices
/// <summary>
/// Load your modules or register your services here!
/// </summary>
/// <param name="kernel">The kernel.</param>
private static void RegisterServices(IKernel kernel)
{
kernel.Bind<IBookingRequestRepository>().To<BookingRequestRepository>();
kernel.Bind<IBookingMainRepository>().To<BookingMainRepository>();
kernel.Bind<ITransactionRepository>().To<TransactionRepository>();
kernel.Bind<ILog>().ToMethod(context => LogManager.GetLogger(context.Request.Target.Member.ReflectedType));
kernel.Bind<IEmailNotification>().To<EmailNotification>();
kernel.BindHttpFilter<BookingApiAuthorizationFilterAttribute>(FilterScope.Global).WhenControllerHas<BookingApiAuthorizationFilterAttribute>();
}
示例3: RegisterServices
/// <summary>
/// Загрузка модулей Ninject и регистрация сервисов.
/// </summary>
/// <param name="kernel">Ядро Ninject.</param>
private static void RegisterServices(IKernel kernel)
{
kernel.Bind<IMongoDBStorage>().ToMethod(c => GetMongoDbStorage()).InSingletonScope();
kernel.BindHttpFilter<BasicAuthenticationFilter>(FilterScope.Controller).WhenControllerHas<BasicAuthenticationAttribute>();
}