예제 #1
0
        public Microsoft.Practices.Unity.IUnityContainer Install(Microsoft.Practices.Unity.IUnityContainer container)
        {
            container
                .RegisterInstance<string>(Keys.ConnectionString, connectionString);

            container
                .RegisterType<IStrategy<DatabaseData>, BulkInsertDataStrategy>()
                .RegisterType<IStrategy<Document>, BackupDeleteCreateDatabaseStrategy>();

            container
                .Install(typeof(BaseInstaller));

            container
                .RegisterType<ICommandPerformer<string>, SqlCommandPerformer>(new PerResolveLifetimeManager(), new InjectionConstructor(new ResolvedParameter<ILog>(), new ResolvedParameter<string>(Keys.ConnectionString)))
                .RegisterType<ICommandPerformer<IBulkInsertDetails>, BulkInsertCommandPerformer>(new PerResolveLifetimeManager(), new InjectionConstructor(new ResolvedParameter<ILog>(), new ResolvedParameter<string>(Keys.ConnectionString)));

            container
                .RegisterType<ICommandFabric, CommandFabric>()
                .RegisterType<Command, CreateDatabaseCommand>(Keys.CreateDatabase)
                .RegisterType<Command, CreatePrimaryKeyCommand>(Keys.CreatePrimary)
                .RegisterType<Command, BulkInsertDataCommand>(Keys.BulkInsertData, new PerResolveLifetimeManager())
                .RegisterType<Command, CreateForeignKeyCommand>(Keys.CreateRelation)
                .RegisterType<Command, CreateTableCommand>(Keys.CreateEntity)
                .RegisterType<Command, BackupDatabaseCommand>(Keys.BackupDatabase)
                .RegisterType<Command, InsertDataCommand>(Keys.InsertData);

            container
                .RegisterType<IValueProvider, DataProvider>(Keys.MsSqlDataProvider);

            return container
                    .RegisterType<ITypeMapper, TypeMapper>();
        }
예제 #2
0
 public void RegisterDependencies(Microsoft.Practices.Unity.IUnityContainer container)
 {
     container.RegisterType(typeof(IAlbumsRepository), typeof(AlbumsRepository), "", null);
     container.RegisterType(typeof(IArtistsRepository), typeof(ArtistRepository), "", null);
     container.RegisterType(typeof(IBaseRepository<Rate>), typeof(RatesRepository), "", null);
     container.RegisterType(typeof(IBaseRepository<Comment>), typeof(CommentsRepository), "", null);
 }
예제 #3
0
 public void RegisterDependencies(Microsoft.Practices.Unity.IUnityContainer container)
 {
     container.RegisterType(typeof(IAlbumsCollectorAppService), typeof(AlbumsCollectorAppService), "", null);
     container.RegisterType(typeof(IBreezeApplicationService<ArtistDTO>), typeof(ArtistCollectorAppService), "", null);
     container.RegisterType(typeof(ICommentsCollectorAppService), typeof(CommentsCollectorAppService), "", null);
     container.RegisterType(typeof(IRatesCollectorAppService), typeof(RatesCollectorAppService), "", null);
     var initializer = new DomainServices.Initialization();
     initializer.RegisterDependencies(container);
 }
예제 #4
0
        private void BuildObjectGraph(Microsoft.Practices.Unity.IUnityContainer unityContainer)
        {
            unityContainer.RegisterType<IPFLogger, PFLogger>();
            //unityContainer.RegisterType<IRaceService, RaceServiceImpl>();
            //RaceProvider.RaceService = unityContainer.Resolve<IRaceService>();
            unityContainer.RegisterType<IDALService, MSSQLDALService>();
            unityContainer.RegisterType<IDALProvider, DALProvider>();

            unityContainer.RegisterType<IAbilityScore, AbilityScore>();
        }
예제 #5
0
 public Microsoft.Practices.Unity.IUnityContainer Install(Microsoft.Practices.Unity.IUnityContainer container)
 {
     return container
         .RegisterType<ICommandExecutor, CommandExecutor>()
         .RegisterType(typeof(ICommandConfiguration<>), typeof(CommandConfiguration<>))
         .RegisterType<IValueProviderFabric, ValueProviderFabric>();
 }
예제 #6
0
 public Microsoft.Practices.Unity.IUnityContainer Install(Microsoft.Practices.Unity.IUnityContainer container)
 {
     return container
        .RegisterType<IValueProvider, CustomStringProvider>(Keys.CustomStringProvider)
        .RegisterType<IValueProvider, RandomStringProvider>(Keys.RandomStringProvider)
        .RegisterType<IValueProvider, IdentityDayDateTimeProvider>(Keys.IdentityDayDateTimeProvider)
        .RegisterType<IValueProvider, RandomDayDateTimeProvider>(Keys.RandomDayDateTimeProvider)
        .RegisterType<IValueProvider, NumberIdentityProvider>(Keys.NumberIdentityProvider)
        .RegisterType<IValueProvider, RandomProxyProvider>(Keys.RandomProxyProvider)
        .RegisterType<IValueProvider, ConstStringProvider>(Keys.ConstStringProvider)
        .RegisterType<IValueProvider, EmptyStringProvider>();
 }
예제 #7
0
        public void Register(Microsoft.Practices.Unity.IUnityContainer container)
        {
        //http://stackoverflow.com/questions/4059991/microsoft-unity-how-to-specify-a-certain-parameter-in-constructor

            container.RegisterType<IDataContextAsync, StripeContext>("dataContextStripe",
                new PerRequestLifetimeManager());

            container.RegisterType<IUnitOfWorkAsync, UnitOfWork>("unitOfWorkStripe",
                new PerRequestLifetimeManager(),
                new InjectionConstructor(
                    new ResolvedParameter<Repository.Pattern.DataContext.IDataContextAsync>("dataContextStripe")
                ));

            container.RegisterType<IRepositoryAsync<StripeConnect>, Repository<StripeConnect>>(
                new InjectionConstructor(
                    new ResolvedParameter<IDataContextAsync>("dataContextStripe"),
                    new ResolvedParameter<IUnitOfWorkAsync>("unitOfWorkStripe")
                ));

            container.RegisterType<IRepositoryAsync<StripeTransaction>, Repository<StripeTransaction>>(
                new InjectionConstructor(
                    new ResolvedParameter<IDataContextAsync>("dataContextStripe"),
                    new ResolvedParameter<IUnitOfWorkAsync>("unitOfWorkStripe")
                ));

            container.RegisterType<IStripeConnectService, StripeConnectService>();
            container.RegisterType<IStripeTransactionService, StripeTransactionService>();
        }
예제 #8
0
 public Microsoft.Practices.Unity.IUnityContainer Install(Microsoft.Practices.Unity.IUnityContainer container)
 {
     return container
         .RegisterType<IMainDirector, Director>()
         .RegisterType<IDataBuilder, StructureBuilder<Document>>("schema")
         .RegisterType<IDataBuilder, StructureBuilder<DocumentDescription>>("schemaDescription")
         .RegisterType<IReadableRepository<Document>, JsonReader<Document>>("schema.json", new InjectionConstructor("schema.json"))
         .RegisterType<IReadableRepository<DocumentDescription>, JsonReader<DocumentDescription>>("schemaDescription.json", new InjectionConstructor("schemaDescription.json"))
         .RegisterType<IReadableRepository<Document>, SchemaJsonReader>(new InjectionConstructor(new ResolvedParameter<IReadableRepository<Document>>("schema.json")))
         .RegisterType<IReadableRepository<DocumentDescription>, SchemaDescriptionJsonReader>(new InjectionConstructor(new ResolvedParameter<IReadableRepository<DocumentDescription>>("schemaDescription.json")))
         .RegisterType<IWritableRepository<Document>, SchemaWriter>()
         .RegisterType<IWritableRepository<DocumentDescription>, SchemaDescriptionWriter>();
 }
예제 #9
0
 public void RegisterDependencies(Microsoft.Practices.Unity.IUnityContainer container)
 {
     container.RegisterType(typeof(ITwitterAuthenticationService), typeof(TwitterAuthenticationService), "", null);
 }
 /// <summary>
 /// The register.
 /// </summary>
 /// <param name="container">
 /// The container.
 /// </param>
 public void Register(Microsoft.Practices.Unity.IUnityContainer container)
 {
     container.RegisterType<MyCustomRule>();
 }
예제 #11
0
 public void InstallDependencies(Microsoft.Practices.Unity.IUnityContainer container)
 {
     //need to register controls to make sure they will have properties injected
     container.RegisterType<SPScriptLinkControl>();
 }