Inheritance: BindingRoot, IKernel
Exemple #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>();
 }
Exemple #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>();
 }
 private static void LoadModules(KernelBase kernel)
 {
     kernel.Load<CatalogNinjectModule>();
     kernel.Load<OrderNinjectModule>();
     kernel.Load<LoggingNinjectModule>();
     kernel.Load<StatisticsNinjectModule>();
 }
 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");

        }
Exemple #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>();
            //

        }
 private static void RegisterServices(KernelBase kernel)
 {
     kernel.Bind<AuthRepository>().To<AuthRepository>();
 }
 private static void RegisterServices(KernelBase kernel)
 {
     kernel.Bind<IStudentSystemData>().To<StudentsSystemData>();
 }
 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>();
 }
		private static void RegisterServices(KernelBase kernel)
		{
			kernel.Bind(typeof(IRepository<>)).To(typeof(EfRepository<>));
            kernel.Bind<IMappingService>().To<MappingService>();
            kernel.Bind<IEventsSystemData>().To<EventsSystemData>().InRequestScope();
		}
 private static void RegisterServices(KernelBase kernel)
 {
     kernel.Bind<IMusicSystemData>().To<MusicSystemData>();
 }
Exemple #16
0
 private static void RegisterServices(KernelBase kernel)
 {
     ResolveDependencies(kernel);
 }
Exemple #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>();
 }