5

__MigrationHistoryCode First Migrations (Entity Framework 4.3) を使用していますが、現在のモデルの圧縮されたバイナリ バージョンを取得して、テーブルに格納されている最新のモデル (または私が持っているモデル) と手動で比較できるようにしたいと考えています。テキストファイルに保存されます)。

メソッドはありますが、EdmMetadata.TryGetModelHash()非推奨としてマークされており、可能であれば避けたいです(将来の理由から)。

EF 4.3 でこれを行うにはどうすればよいですか?

編集:もう少し調査とPawel の回答の情報から、このフィールドにはもはやハッシュではなく、モデルの圧縮されたバイナリ表現が格納されていることがわかりました。作ろうとしているのはこれです。

4

1 に答える 1

9

__MigrationHistory table no longer contains a hash of the model. Instead it now contains the model in the compressed form. Also, verifying whether the model changed or not no longer relies on just comparing the hash since Migrations need to "know" what changed and how it did change.

EdmMetadata was a table that was being used before Migrations were integrated to Entity Framowork in 4.3/5.0 and won't be created in databases created by EF 4.3+. You can find some additional details here as well: http://blog.oneunicorn.com/2012/01/13/ef-4-3-beta-1-what-happened-to-that-edmmetadata-table/

于 2012-05-22T00:28:52.520 に答える