Ejemplo n.º 1
0
    public void Prepare(WriteToSqlMutator process, DetailedDbTableDefinition tableDefinition)
    {
        _tableDefinition = tableDefinition;

        _allDbColumns          = string.Join(", ", _tableDefinition.Columns.Select(x => x.DbColumn));
        _keyDbColumns          = string.Join(" AND ", _tableDefinition.Columns.Where(x => x.IsKey).Select(x => "target." + x.DbColumn + " = source." + x.DbColumn));
        _updateDbColumns       = string.Join(",\n\t\t", _tableDefinition.Columns.Where(x => !x.IsKey).Select(x => x.DbColumn + " = source." + x.DbColumn));
        _insertDbColumnsTarget = string.Join(", ", _tableDefinition.Columns.Where(x => x.Insert).Select(x => x.DbColumn));
        _insertDbColumnsSource = string.Join(", ", _tableDefinition.Columns.Where(x => x.Insert).Select(x => "source." + x.DbColumn));
    }
Ejemplo n.º 2
0
 public void Prepare(WriteToSqlMutator process, DetailedDbTableDefinition tableDefinition)
 {
     _tableDefinition = tableDefinition;
     _columns         = _tableDefinition.Columns.Where(x => x.Insert).ToArray();
     _dbColumns       = string.Join(", ", _columns.Select(x => x.DbColumn));
 }