c# - Creating a join using a link table and the Entity Framework -


I am currently struggling with ASP.NET and MVC3 to display a person. I have a table for the person's information, type of person. A person can be of different types, so I created a link table that links to the person and typed. I am struggling to find a way for user specifications and different types of P [IH.

Then ActionResult is taking a PersonID and I can display the person's information properly, but I have to pass a list of those types of which they are part of.

Any help, examples or links for tutorials would be great. thank you in advanced.

Here's what's in my controller.

  Public view result description (long id) {champion champion = _db.champions.Single (c = & gt; c.id == ID); See Return (Champion); }   

I tried to use a ViewBag object and a join statement but it became very complicated and I went beyond the knowledge of the Linq statement.

  var champion = _db.champions.Include ("TheOtherModel "). SingleLow Default (c => c.id == ID); See Return (Champion);   

and you

  champions. Other models should have access to "TheOtherModel" using   

or see yours:

  @forach (item item in model. Other models) {item .Property1 ....}   

(There should be a list in it).

Comments