Beispiel #1
0
        public static InputInfo CreateInputClassInfo(XPDictionary outputDictionary, string inputPutClass, params ColumnInfo[] columnInfos) {
            var table = CreateDbTable(inputPutClass, columnInfos);

            var dataSet = new DataSet();
            var inputUnitOfWork = new UnitOfWork(new SimpleDataLayer(new DataSetDataStore(dataSet, AutoCreateOption.DatabaseAndSchema)));
            var dictionaryMapper = new DictionaryMapper(new[] { table });
            dictionaryMapper.Map(outputDictionary, inputUnitOfWork.Dictionary);
            var classInfo = inputUnitOfWork.Dictionary.QueryClassInfo(null, inputPutClass);
            return new InputInfo(classInfo, inputUnitOfWork, dataSet);
        }
Beispiel #2
0
        public void Import(Func<UnitOfWork> createOutputUow, Func<UnitOfWork> createInputOuw) {
            using (UnitOfWork mainOutputUow = createOutputUow()) {
                using (UnitOfWork mainInputUow = createInputOuw()) {
                    OnCreatingDynamicDictionary();
                    var dataStoreSchemaExplorer = (IDataStoreSchemaExplorer)((BaseDataLayer)mainInputUow.DataLayer).ConnectionProvider;
                    var dictionaryMapper = new DictionaryMapper(dataStoreSchemaExplorer.GetStorageTables(dataStoreSchemaExplorer.GetStorageTablesList(true)));
                    dictionaryMapper.Map(mainOutputUow.Dictionary, mainInputUow.Dictionary);
                    foreach (var objectClassInfo in dictionaryMapper.InputClassInfos) {
                        ImportCore(createOutputUow, createInputOuw, objectClassInfo);
                    }
                    OnCommitingData();
                    ClearObjectCache();
                }
            }

        }
Beispiel #3
0
 public void Import(Func<UnitOfWork> createOutputUow, Func<UnitOfWork> createInputOuw) {
     Tracing.Tracer.LogVerboseSubSeparator("Import started");
     using (UnitOfWork mainOutputUow = createOutputUow()) {
         using (UnitOfWork mainInputUow = createInputOuw()) {
             OnCreatingDynamicDictionary();
             var dataStoreSchemaExplorer = (IDataStoreSchemaExplorer)((BaseDataLayer)mainInputUow.DataLayer).ConnectionProvider;
             var dictionaryMapper = new DictionaryMapper(dataStoreSchemaExplorer.GetStorageTables(dataStoreSchemaExplorer.GetStorageTablesList(true)));
             dictionaryMapper.Map(mainOutputUow.Dictionary, mainInputUow.Dictionary);
             Tracing.Tracer.LogVerboseText("Dictionary created");
             foreach (var objectClassInfo in dictionaryMapper.InputClassInfos) {
                 ImportCore(createOutputUow, createInputOuw, objectClassInfo);
             }
             Tracing.Tracer.LogVerboseText("Comming data");
             OnCommitingData();
             Tracing.Tracer.LogVerboseText("Data commited");
             ClearObjectCache();
         }
     }
     Tracing.Tracer.LogVerboseSubSeparator("Import finished");
 }
Beispiel #4
0
 public void Import(Func <UnitOfWork> createOutputUow, Func <UnitOfWork> createInputOuw)
 {
     Tracing.Tracer.LogVerboseSubSeparator("Import started");
     using (UnitOfWork mainOutputUow = createOutputUow()) {
         using (UnitOfWork mainInputUow = createInputOuw()) {
             OnCreatingDynamicDictionary();
             var dataStoreSchemaExplorer = (IDataStoreSchemaExplorer)((BaseDataLayer)mainInputUow.DataLayer).ConnectionProvider;
             var dictionaryMapper        = new DictionaryMapper(dataStoreSchemaExplorer.GetStorageTables(dataStoreSchemaExplorer.GetStorageTablesList(true)));
             dictionaryMapper.Map(mainOutputUow.Dictionary, mainInputUow.Dictionary);
             Tracing.Tracer.LogVerboseText("Dictionary created");
             foreach (var objectClassInfo in dictionaryMapper.InputClassInfos)
             {
                 ImportCore(createOutputUow, createInputOuw, objectClassInfo);
             }
             Tracing.Tracer.LogVerboseText("Comming data");
             OnCommitingData();
             Tracing.Tracer.LogVerboseText("Data commited");
             ClearObjectCache();
         }
     }
     Tracing.Tracer.LogVerboseSubSeparator("Import finished");
 }