コード例 #1
0
 public CommonEntityStageManager(UserConnection userConnection,
                                 IGetRepository <CommonStageData> entityStageRepository,
                                 ICommonEntityInStageRepository <EntityInHistoricalStage> entityInStageRepository,
                                 StageHistorySetting stageHistorySetting)
     : base(userConnection, entityStageRepository, entityInStageRepository, stageHistorySetting)
 {
 }
コード例 #2
0
        private void CreateSettingFromEntity(Entity entity)
        {
            var setting = new StageHistorySetting(UserConnection);

            setting.FillFromEntity(entity);
            SetStageHistoryToCache(setting);
        }
コード例 #3
0
        private void SetStageHistoryToCache(StageHistorySetting setting)
        {
            var cache = GetSafelyStageHistoryFromCache();

            cache[setting.EntitySchemaUId]            = setting;
            UserConnection.ApplicationCache[CacheKey] = cache;
        }
コード例 #4
0
        /// <inheritdoc />
        public void Save(StageHistorySetting setting)
        {
            setting.CheckArgumentNull(nameof(setting));
            EntitySchema schema = UserConnection.EntitySchemaManager
                                  .GetInstanceByName(SysModuleStageHistorySchemaName);
            var entity = schema.CreateEntity(UserConnection);

            entity.FetchFromDB(setting.Id);
            setting.FillEntity(entity);
            entity.Save(false);
            SetStageHistoryToCache(setting);
        }
        /// <summary>
        /// Returns proxy <see cref="CacheGetRepositoryProxy{TData}"/> of <see cref="FullPipelineStageGetRepository"/>
        /// </summary>
        /// <param name="stageHistorySetting"><see cref="StageHistorySetting"/></param>
        /// <returns>proxy <see cref="CacheGetRepositoryProxy{TData}"/> of <see cref="FullPipelineStageGetRepository"/></returns>
        public IGetRepository <CommonStageData> GetRepository(StageHistorySetting stageHistorySetting)
        {
            var repository = ClassFactory
                             .Get <FullPipelineStageGetRepository>(
                new ConstructorArgument("userConnection", _userConnection),
                new ConstructorArgument("stageHistorySetting", stageHistorySetting));
            var cacheRepository = ClassFactory
                                  .Get <CacheGetRepositoryProxy <CommonStageData> >(
                new ConstructorArgument("userConnection", _userConnection),
                new ConstructorArgument("repository", repository),
                new ConstructorArgument("schemaName", stageHistorySetting.StageSchemaName));

            return(cacheRepository);
        }
コード例 #6
0
        private IEntityStageManagerV2 GetEntityStageManager(UserConnection userConnection,
                                                            StageHistorySetting setting)
        {
            var entityStageRepository = ClassFactory.Get <IGetRepository <CommonStageData> >("StageGetRepository",
                                                                                             new ConstructorArgument("userConnection", userConnection),
                                                                                             new ConstructorArgument("stageHistorySetting", setting));
            var cacheGetRepositoryProxy = ClassFactory.Get <CacheGetRepositoryProxy <CommonStageData> >(
                new ConstructorArgument("userConnection", userConnection),
                new ConstructorArgument("repository", entityStageRepository),
                new ConstructorArgument("schemaName", setting.StageSchemaName));
            var entityInStageRepository = ClassFactory.Get <ICommonEntityInStageRepository <EntityInHistoricalStage> >(
                new ConstructorArgument("userConnection", userConnection),
                new ConstructorArgument("stageHistorySetting", setting));

            return(ClassFactory.Get <IEntityStageManagerV2>(new ConstructorArgument("userConnection", userConnection),
                                                            new ConstructorArgument("entityStageRepository", cacheGetRepositoryProxy),
                                                            new ConstructorArgument("entityInStageRepository", entityInStageRepository),
                                                            new ConstructorArgument("stageHistorySetting", setting)));
        }
コード例 #7
0
        private static bool IsChangedColumn(EntityAfterEventArgs entityAfterEventArgs, StageHistorySetting setting)
        {
            var column = entityAfterEventArgs?.ModifiedColumnValues?.FindByName(setting.StageColumnName + "Id");

            return(column != null);
        }
コード例 #8
0
 private static bool IsStagedEntity(Entity entity, StageHistorySetting setting)
 {
     return(setting?.IsActive ?? false);
 }
コード例 #9
0
        private void ClearStageSchemaCache(StageHistorySetting currentSchemaSetting)
        {
            string schemaName = currentSchemaSetting.StageSchemaName;

            _userConnection.ApplicationCache.ExpireGroup(schemaName);
        }
 public FullPipelineStageGetRepository(UserConnection userConnection, StageHistorySetting stageHistorySetting)
     : base(userConnection, stageHistorySetting)
 {
 }
コード例 #11
0
 public StageGetRepository(UserConnection userConnection, StageHistorySetting stageHistorySetting)
     : base(userConnection, stageHistorySetting.StageSchemaName)
 {
     StageHistorySetting = stageHistorySetting;
 }
コード例 #12
0
 public CommonEntityInStageRepository(UserConnection userConnection, StageHistorySetting stageHistorySetting)
     : base(userConnection, stageHistorySetting)
 {
 }
コード例 #13
0
 public CommonEntityStageRepository(UserConnection userConnection, StageHistorySetting entitySchemaConfig)
     : base(userConnection, entitySchemaConfig)
 {
 }