示例#1
0
        public static ReplicationTable ConvertSchemaToReplicationTable(Schema schema, string schemaName,
                                                                       string tableName)
        {
            var table = new ReplicationTable
            {
                SchemaName = schemaName,
                TableName  = tableName,
                Columns    = new List <ReplicationColumn>()
            };

            foreach (var property in schema.Properties)
            {
                var column = new ReplicationColumn
                {
                    ColumnName = property.Name,
                    DataType   = string.IsNullOrWhiteSpace(property.TypeAtSource)? GetType(property.Type): property.TypeAtSource,
                    PrimaryKey = false
                };

                table.Columns.Add(column);
            }

            return(table);
        }
示例#2
0
        public static ReplicationTable ConvertSchemaToReplicationTable(Schema schema, string schemaName,
                                                                       string tableName)
        {
            var table = new ReplicationTable
            {
                SchemaName = schemaName,
                TableName  = tableName,
                Columns    = new List <ReplicationColumn>()
            };

            foreach (var property in schema.Properties)
            {
                var column = new ReplicationColumn
                {
                    ColumnName = property.Name,
                    DataType   = $"VARCHAR({int.MaxValue})",
                    PrimaryKey = false
                };

                table.Columns.Add(column);
            }

            return(table);
        }