2017-12-31 71 views
2

私はEF6コードを調べていました。 IEntityWrapperインターフェイス、BaseEntityWrapperクラス、およびEntityWrapperが発生しました。Entity FrameworkのIEntityWrapperインターフェイスの背後にあるデザインパターンは?

ここに実装されているデザインパターンは何ですか?

https://github.com/aspnet/EntityFramework6/blob/master/src/EntityFramework/Core/Objects/Internal/IEntityWrapper.cs https://github.com/aspnet/EntityFramework6/blob/master/src/EntityFramework/Core/Objects/Internal/BaseEntityWrapper.cs https://github.com/aspnet/EntityFramework6/blob/master/src/EntityFramework/Core/Objects/Internal/EntityWrapper.cs

+1

私は[Adapter](https://en.wikipedia.org/wiki/Adapter_pattern)と思う。 –

答えて

1

基本的に2つの設計パターンがEntity Frameworkの中で実装されている

  1. 作業パターンの単位
  2. リポジトリパターン

それはオーバー汎用ラッパーですリポジトリパターン、およびDBContextクラスは、作業パターンの単位を表します。

リポジトリパターンはIEntityWrapperインターフェイスの背後にあります。

+0

IEntityWrapperはリポジトリの汎用ラッパーですか?しかし、実際にエンティティをラップします! –

関連する問題