0

I have the following tables as part of my Databases:-

enter image description here

But I am not sure if it is possible to retrieve the following related information (using Entity Framework inside my asp.net mvc web application), when passing the AccountDefinition.ORG_ID:-

  • AaaUser
  • AaaContactInfo

I have defined the following action method:-

public ActionResult Index(string searchTerm=null)
        {   var accountdefinition = repository.FindAccountDefinition(searchTerm).ToList();

            return View(accountdefinition);}

But how can i retrieve the above objects(AaaUser & AaaContactInfo) based on the AccountDefinition.ORG_ID value, and then pass the object to the view. baring in mind that the relation can either start from the AccountSiteMapping OR from the SDOrgContactInfo tables, as shown in the diagram.

4

1 回答 1

1

您应该在存储库中使用 include 方法。
http://msdn.microsoft.com/en-us/data/jj574232.aspx

于 2013-07-08T18:51:43.480 回答