我怀疑有一个隐藏的开关。我有同样的问题,所以我写了一个简单的 Perl 脚本来解决它:
# Usage: fdbml.pl in.dbml out.dbml
my $in_file = $ARGV[0];
my $out_file = $ARGV[1];
# Scrape in file for identifiers
my @identifiers;
open IN, "<$in_file";
while (<IN>) {
if ($_ =~ /<Table Name="(?:\w+\.)?(\w+)" Member="(\w+)"/) { push @identifiers, "$1 $2"; }
if ($_ =~ /<Function Name="(?:\w+\.)?(\w+)" Method="(\w+)"/) { push @identifiers, "$1 $2"; }
}
close IN;
# Translate in file to out file
open IN, "<$in_file";
open OUT, ">$out_file";
while (<IN>) {
my $line = $_;
# Replace identifiers
foreach my $identifier (@identifiers) {
my ($new, $old) = split(' ', $identifier);
$line =~ s/"$old((?:Result)?)"/"$new$1"/g;
}
$line =~ s/<Parameter Name="(\w+)" Parameter="\w+"/<Parameter Name="$1" Parameter="$1"/;
print OUT $line;
}
close OUT;
close IN;
只需将所有内容保存到 fdbml.pl,确保您安装了 ActiveState Perl,然后在您的 DBML 文件上运行它:
fdbml.pl old.dbml new.dbml
本