Наследование: BindingRoot, IKernel
Пример #1
0
 private static void RegisterServices(KernelBase kernel)
 {
     kernel.Bind<ICategory>().To<Category>();
     kernel.Bind<IUnitOfWork>().To<UnitOfWork>();
     kernel.Bind(typeof(IGenericRepository<>)).To(typeof(GenericRepository<>));
     kernel.Bind<ERPInventoryDBContext>().To<ERPInventoryDBContext>();
 }
Пример #2
0
        private static void SetupAuth(IAppBuilder app, KernelBase kernel)
        {
            app.UseFormsAuthentication(new FormsAuthenticationOptions
            {
                LoginPath = "/account/login",
                LogoutPath = "/account/logout",
                CookieHttpOnly = true,
                AuthenticationType = Constants.JabbRAuthType,
                CookieName = "jabbr.id",
                ExpireTimeSpan = TimeSpan.FromDays(30),
                DataProtection = kernel.Get<IDataProtection>(),
                Provider = kernel.Get<IFormsAuthenticationProvider>()
            });

            //var config = new FederationConfiguration(loadConfig: false);
            //config.WsFederationConfiguration.Issuer = "";
            //config.WsFederationConfiguration.Realm = "http://localhost:16207/";
            //config.WsFederationConfiguration.Reply = "http://localhost:16207/wsfederation";
            //var cbi = new ConfigurationBasedIssuerNameRegistry();
            //cbi.AddTrustedIssuer("", "");
            //config.IdentityConfiguration.AudienceRestriction.AllowedAudienceUris.Add(new Uri("http://localhost:16207/"));
            //config.IdentityConfiguration.IssuerNameRegistry = cbi;
            //config.IdentityConfiguration.CertificateValidationMode = X509CertificateValidationMode.None;
            //config.IdentityConfiguration.CertificateValidator = X509CertificateValidator.None;

            //app.UseFederationAuthentication(new FederationAuthenticationOptions
            //{
            //    ReturnPath = "/wsfederation",
            //    SigninAsAuthenticationType = Constants.JabbRAuthType,
            //    FederationConfiguration = config,
            //    Provider = new FederationAuthenticationProvider()
            //});

            app.Use(typeof(WindowsPrincipalHandler));
        }
 public void Setup()
 {
     kernel = new StandardKernel(new NinjectAPIModule());
     nutritionalInformationController = kernel.Get<NutritionalInformationController>();
     nutritionalInformationController.Request = Substitute.For<HttpRequestMessage>();
     nutritionalInformationController.Configuration = Substitute.For<HttpConfiguration>();
 }
Пример #4
0
 private static void LoadModules(KernelBase kernel)
 {
     kernel.Load<CatalogNinjectModule>();
     kernel.Load<OrderNinjectModule>();
     kernel.Load<LoggingNinjectModule>();
     kernel.Load<StatisticsNinjectModule>();
 }
Пример #5
0
 private static void ConfigureMediator(KernelBase kernel)
 {
     kernel.Components.Add<IBindingResolver, ContravariantBindingResolver>();
     kernel.Bind<SingleInstanceFactory>().ToMethod(ctx => t => ctx.Kernel.Get(t));
     kernel.Bind<MultiInstanceFactory>().ToMethod(ctx => t => ctx.Kernel.GetAll(t));
     kernel.Bind<IMediator>().To<Mediator>();
 }
 public void Setup()
 {
     kernel = new StandardKernel(new NinjectAPIModule());
     uriLocationsController = kernel.Get<UriLocationsController>();
     uriLocationsController.Request = Substitute.For<HttpRequestMessage>();
     uriLocationsController.Configuration = Substitute.For<HttpConfiguration>();
 }
        public void Setup()
        {
            WithRealDb();
            _kernel = new StandardKernel();
            _kernel.Bind<IDatabase>().ToConstant(Db);

            Mocker.GetMock<ConfigProvider>().SetupGet(s => s.ServiceRootUrl)
                    .Returns("http://stage.services.nzbdrone.com");

        }
Пример #8
0
        /// <summary>
        /// Registers the services.
        /// </summary>
        /// <param name="kernel">The kernel.</param>
        private static void RegisterServices(KernelBase kernel)
        {
            kernel.Bind<IOAuthAuthorizationServerOptions>().To<MyOAuthAuthorizationServerOptions>();
            kernel.Bind<IOAuthAuthorizationServerProvider>().To<SimpleAuthorizationServerProvider>();
            kernel.Bind<IAuthenticationTokenProvider>().To<SimpleRefreshTokenProvider>();

            kernel.Bind<IUnitOfWork>().To<UnitOfWork>();
            //
            kernel.Bind<IUserRepository>().To<UserRepository>();
            kernel.Bind<IAuthRepository>().To<AuthRepository>();
            kernel.Bind<IBidRepository>().To<BidRepository>();
            kernel.Bind<ICityRepository>().To<CityRepository>();
            kernel.Bind<ITourRepository>().To<TourRepository>();
            //

        }
Пример #9
0
 private static void RegisterServices(KernelBase kernel)
 {
     kernel.Bind<AuthRepository>().To<AuthRepository>();
 }
Пример #10
0
 private static void RegisterServices(KernelBase kernel)
 {
     kernel.Bind<IStudentSystemData>().To<StudentsSystemData>();
 }
Пример #11
0
 private static void LoadModules(KernelBase kernel)
 {
     kernel.Load<OrderNinjectModule>();
     kernel.Load<AccountNinjectModule>();
 }
 public void Setup()
 {
     kernel = new StandardKernel(new NinjectAPIModule());
     recipeManager = kernel.Get<RecipeManager>();
 }     
 public void Setup()
 {
     kernel = new StandardKernel(new NinjectAPIModule());
     clientService = kernel.Get<ClientService>();
 }
Пример #14
0
		private static void RegisterServices(KernelBase kernel)
		{
			kernel.Bind(typeof(IRepository<>)).To(typeof(EfRepository<>));
            kernel.Bind<IMappingService>().To<MappingService>();
            kernel.Bind<IEventsSystemData>().To<EventsSystemData>().InRequestScope();
		}
Пример #15
0
 private static void RegisterServices(KernelBase kernel)
 {
     kernel.Bind<IMusicSystemData>().To<MusicSystemData>();
 }
Пример #16
0
 private static void RegisterServices(KernelBase kernel)
 {
     ResolveDependencies(kernel);
 }
Пример #17
0
 private static void RegisterServices(KernelBase kernel)
 {
     kernel.Bind<IdentityDbContext<User, CustomRole, int, CustomUserLogin, CustomUserRole, CustomUserClaim>>().To<Just_DIYDbContext>();
     kernel.Bind<IJustDIYData>().To<JustDIYData>();
 }