は、この機能はEF 5またはEF 6
の周りになるだろうされていないように私は、DBファーストを生成した後EDMXを更新するために迅速なコンソールアプリケーションを手早くようです。
ファイルをedmxファイルの同じディレクトリにドロップし、すべての再生成後に実行してください。
は、次の列のいずれかのために動作します:
RowVersion timestamp NOT NULL
rowversion timestamp NOT NULL
RowVer timestamp NOT NULL
rowver timestamp NOT NULL
あなたはhttps://dl.dropbox.com/u/3576345/EFConcurrencyFixed.exe
ここでコンソールアプリを取得したり、独自のコンソールアプリケーションのコードのこの部分を使用することができます。
class Program
{
static Dictionary<string, string> replacements = new Dictionary<string, string>()
{
{ "<Property Type=\"Binary\" Name=\"RowVersion\" Nullable=\"false\" MaxLength=\"8\" FixedLength=\"true\" annotation:StoreGeneratedPattern=\"Computed\" />",
"<Property Type=\"Binary\" Name=\"RowVersion\" Nullable=\"false\" MaxLength=\"8\" FixedLength=\"true\" annotation:StoreGeneratedPattern=\"Computed\" ConcurrencyMode=\"Fixed\" />"},
{ "<Property Type=\"Binary\" Name=\"rowversion\" Nullable=\"false\" MaxLength=\"8\" FixedLength=\"true\" annotation:StoreGeneratedPattern=\"Computed\" />",
"<Property Type=\"Binary\" Name=\"rowversion\" Nullable=\"false\" MaxLength=\"8\" FixedLength=\"true\" annotation:StoreGeneratedPattern=\"Computed\" ConcurrencyMode=\"Fixed\" />"},
{ "<Property Type=\"Binary\" Name=\"RowVer\" Nullable=\"false\" MaxLength=\"8\" FixedLength=\"true\" annotation:StoreGeneratedPattern=\"Computed\" />",
"<Property Type=\"Binary\" Name=\"RowVer\" Nullable=\"false\" MaxLength=\"8\" FixedLength=\"true\" annotation:StoreGeneratedPattern=\"Computed\" ConcurrencyMode=\"Fixed\" />"},
{ "<Property Type=\"Binary\" Name=\"rowver\" Nullable=\"false\" MaxLength=\"8\" FixedLength=\"true\" annotation:StoreGeneratedPattern=\"Computed\" />",
"<Property Type=\"Binary\" Name=\"rowver\" Nullable=\"false\" MaxLength=\"8\" FixedLength=\"true\" annotation:StoreGeneratedPattern=\"Computed\" ConcurrencyMode=\"Fixed\" />"},
};
static void Main(string[] args)
{
// find all .edmx
string directoryPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
foreach (var file in Directory.GetFiles(directoryPath))
{
// only edmx
if (!file.EndsWith(".edmx"))
continue;
// read file
var fileContents = System.IO.File.ReadAllText(file);
// replace lines
foreach (var item in replacements)
fileContents = fileContents.Replace(item.Key, item.Value);
// overwite file
System.IO.File.WriteAllText(file, fileContents);
}
}
}
XSLTのために働いていますか? –
私は慣習で何かを逃した何か組み込みのものを望んでいました。これは標準的な要件です。ほとんどのDBアプリケーションでは、並行性の制御が必要です。 –
なぜこのような基本機能が存在しないのか分かりません。 EF CodePlexで機能要求を出しました[ConcurrencyMode = Fixed](http://entityframework.codeplex.com/workitem/588) –