Esempio n. 1
0
        private static void CleanTableAndBulkInsert(DbTable table, IEnumerable <IMyMemory> entitiesToInsert,
                                                    DataSynchronizationPeriod syncPeriod)
        {
            table.CleanAndBulkInsert(entitiesToInsert);

            ServiceLocator.SnapshotSaverScheduler.SynchronizeTable(table, syncPeriod);
            ServiceLocator.DataSynchronizer?.PublishInitTable(table);
        }
Esempio n. 2
0
        private static void CleanPartitionAndBulkInsert(DbTable table, IEnumerable <IMyMemory> entitiesToInsert, string partitionKey,
                                                        DataSynchronizationPeriod syncPeriod)
        {
            var partitionsToSynchronize = table.CleanAndBulkInsert(partitionKey, entitiesToInsert);

            foreach (var dbPartition in partitionsToSynchronize)
            {
                ServiceLocator.SnapshotSaverScheduler.SynchronizePartition(table, dbPartition, syncPeriod);
                ServiceLocator.DataSynchronizer?.PublishInitPartition(table, dbPartition);
            }
        }