コード例 #1
0
 protected override void BeginProcessing()
 {
     var storeSettings = StoreSettings.DefaultSettings();
     storeSettings.ConnectionString = ConnectionString ?? storeSettings.ConnectionString;
     storeSettings.Database = Database ?? storeSettings.Database;
     storeSettings.ClientCollection = ClientCollection ?? storeSettings.ClientCollection;
     storeSettings.ScopeCollection = ScopeCollection ?? storeSettings.ScopeCollection;
     storeSettings.ConsentCollection = ConsentCollection ?? storeSettings.ConsentCollection;
     storeSettings.AuthorizationCodeCollection = AuthorizationCodeCollection ?? storeSettings.AuthorizationCodeCollection;
     storeSettings.RefreshTokenCollection = RefreshTokenCollection ?? storeSettings.RefreshTokenCollection;
     storeSettings.TokenHandleCollection = TokenHandleCollection ?? storeSettings.TokenHandleCollection;
     CanCreateDatabase(storeSettings);
     
     var serviceFactory = new ServiceFactory(null, storeSettings);
     var factory = new Factory(serviceFactory, new AdminServiceRegistry());
     _adminService = factory.Resolve<IAdminService>();
     _tokenCleanupService = factory.Resolve<ICleanupExpiredTokens>();
     _scopeStore = factory.Resolve<IScopeStore>();
     base.BeginProcessing();
 }
コード例 #2
0
        void Run2()
        {
            var factory = new Factory();
            factory.RegisterTransient(getHello2);

            //-------------
            var hello = factory.Resolve<ISayHello>();
            hello.SayHello("Jim");
        }