public void Act()
 {
     using (var source = _connectionFactory.CreateConnection(_schemaMetadata[ConnectionStringName.CustomerIntelligence]))
         using (var target = _connectionFactory.CreateConnection(_schemaMetadata[ConnectionStringName.Statistics]))
         {
             var transformed = source.GetTable <CI::FirmCategory>()
                               .Select(x => new Statistics::FirmCategoryStatistics {
                 FirmId = x.FirmId, CategoryId = x.CategoryId
             })
                               .ToArray();
             target.GetTable <Statistics::FirmCategoryStatistics>().BulkCopy(transformed);
         }
 }
Ejemplo n.º 2
0
        private IBulkReplicatorFactory CreateReplicatorFactory(BulkReplicationMetadataElement bulkReplicationMetadata)
        {
            var sourceStorageDescriptor = bulkReplicationMetadata.Features.OfType <StorageDescriptorFeature>().Single(x => x.Direction == ReplicationDirection.From);
            var targetStorageDescriptor = bulkReplicationMetadata.Features.OfType <StorageDescriptorFeature>().Single(x => x.Direction == ReplicationDirection.To);

            return(new RoutingBulkReplicatorFactory(_dataConnectionFactory.CreateConnection(sourceStorageDescriptor), _dataConnectionFactory.CreateConnection(targetStorageDescriptor)));
        }
Ejemplo n.º 3
0
        protected override void Execute(SchemaMetadataElement metadataElement)
        {
            var entities = _contextEntityTypesProvider.GetTypesFromContext(metadataElement.Context);

            using (var dataConnection = _dataConnectionFactory.CreateConnection(metadataElement))
            {
                var sqlSchemaService = new SqlSchemaService(dataConnection);
                sqlSchemaService.CreateTables(entities);
            }
        }