Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
MVC3 の 1 つのビューで 2 つの異なる ado.net エンティティを使用するにはどうすればよいですか?
両方のエンティティをカプセル化するモデルを作成できます。
public class MyViewModel { public AdoEntityA { get; set; } public AdoEntityB { get; set; } }
または、2 つのエンティティから必要な特定のフィールドのみを保持するビュー モデルを作成することもできます。
Automapper は、ドメイン エンティティとビュー モデルの間の非常に便利なマッピングです。