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

        }
Exemplo n.º 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>();
            //

        }
Exemplo n.º 9
0
 private static void RegisterServices(KernelBase kernel)
 {
     kernel.Bind<AuthRepository>().To<AuthRepository>();
 }
Exemplo n.º 10
0
 private static void RegisterServices(KernelBase kernel)
 {
     kernel.Bind<IStudentSystemData>().To<StudentsSystemData>();
 }
Exemplo n.º 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>();
 }
Exemplo n.º 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();
		}
Exemplo n.º 15
0
 private static void RegisterServices(KernelBase kernel)
 {
     kernel.Bind<IMusicSystemData>().To<MusicSystemData>();
 }
Exemplo n.º 16
0
 private static void RegisterServices(KernelBase kernel)
 {
     ResolveDependencies(kernel);
 }
Exemplo n.º 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>();
 }