コード例 #1
0
        public static IClientTransactionRepository GetTransactionRepository()
        {
            // See if the ITransactionRepository instance was already created
            if (ClientTransactionRepositoryFactory.transactionRepository == null)
            {
                // It was not created, so build it now
                RepositorySettings settings = 
                    (RepositorySettings)ConfigurationManager.GetSection(
                    RepositoryMappingConstants.RepositoryMappingsConfigurationSectionName);

                // Get the type to be created
                Type repositoryType = 
                    Type.GetType(
                    settings.RepositoryMappings["IClientTransactionRepository"].RepositoryFullTypeName);

                // Create the repository, and cast it to the 
                // ITransactionRepository interface
                ClientTransactionRepositoryFactory.transactionRepository = 
                    Activator.CreateInstance(repositoryType) 
                    as IClientTransactionRepository;

            }

            return ClientTransactionRepositoryFactory.transactionRepository;
        }
コード例 #2
0
        public void GetTransactionRepositoryTest()
        {
            IClientTransactionRepository repository = ClientTransactionRepositoryFactory.GetTransactionRepository();

            Assert.AreNotEqual(null, repository);
            Assert.AreEqual("SqlCeClientTransactionRepository", repository.GetType().Name);
            this.testContextInstance.WriteLine("Created an ITransactionRepository of type {0}", repository.GetType().FullName);
        }
コード例 #3
0
 public static IClientTransactionRepository GetTransactionRepository()
 {
     if (ClientTransactionRepositoryFactory.transactionRepository == null)
     {
         RepositorySettings settings =
             (RepositorySettings)ConfigurationManager.GetSection(RepositoryMappingConstants.RepositoryMappingsConfigurationSectionName);
         Type repositoryType = Type.GetType(settings.RepositoryMappings["IClientTransactionRepository"].RepositoryFullTypeName);
         ClientTransactionRepositoryFactory.transactionRepository = Activator.CreateInstance(repositoryType) as IClientTransactionRepository;
     }
     return(transactionRepository);
 }
コード例 #4
0
 public UnitOfWork()
 {
     this.key = Guid.NewGuid();
     this.clientTransactionRepository = ClientTransactionRepositoryFactory.GetTransactionRepository();
     this.addedEntities = new Dictionary <IEntity,
                                          IUnitOfWorkRepository>();
     this.changedEntities = new Dictionary <IEntity,
                                            IUnitOfWorkRepository>();
     this.deletedEntities = new Dictionary <IEntity,
                                            IUnitOfWorkRepository>();
 }
コード例 #5
0
ファイル: UnitOfWork.cs プロジェクト: pachinko/NDDDCS
 public UnitOfWork()
 {
     this.key = Guid.NewGuid();
     this.clientTransactionRepository = ClientTransactionRepositoryFactory.GetTransactionRepository();
     this.addedEntities = new Dictionary<IEntity, 
                              IUnitOfWorkRepository>();
     this.changedEntities = new Dictionary<IEntity, 
                                IUnitOfWorkRepository>();
     this.deletedEntities = new Dictionary<IEntity, 
                                IUnitOfWorkRepository>();
 }
コード例 #6
0
        public static IClientTransactionRepository GetTransactionRepository()
        {
            // See if the ITransactionRepository instance was already created
            if (ClientTransactionRepositoryFactory.transactionRepository == null)
            {
                // It was not created, so build it now
                RepositorySettings settings =
                    (RepositorySettings)ConfigurationManager.GetSection(
                        RepositoryMappingConstants.RepositoryMappingsConfigurationSectionName);

                // Get the type to be created
                Type repositoryType =
                    Type.GetType(
                        settings.RepositoryMappings["IClientTransactionRepository"].RepositoryFullTypeName);

                // Create the repository, and cast it to the
                // ITransactionRepository interface
                ClientTransactionRepositoryFactory.transactionRepository =
                    Activator.CreateInstance(repositoryType)
                    as IClientTransactionRepository;
            }

            return(ClientTransactionRepositoryFactory.transactionRepository);
        }
コード例 #7
0
 public UnitOfWork()
 {
     this.key = Guid.NewGuid();
     this.clientTransactionRepository = ClientTransactionRepositoryFactory.GetTransactionRepository();
     this.operations = new List <Operation>();
 }