title: Using a foreign key in dropdown in mvc
body: <p>I'm new to MVC, and stuck on what should be a pretty straight forward issue.  I'm working through <a href="http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/cs/intro-to-aspnet-mvc-3" rel="nofollow">this tutorial</a> and got everything pretty much working, except I now want to add a foreign key 'link' (not sure what it's called) but can't seem to get it to work.  Here's what I have:</p>
  
  <p>Tables:</p>
  
  <pre><code> Inventory:
   Id   |  SerialNumber  | ManufacturerId (foreignkey to Manufactueres-&gt;id)
  
   Manufactureres
   Id (primary key)   |  Name
  </code></pre>
  
  <p>Model (InventoryItem.cs):</p>
  
  <pre><code> public class InventoryItem {
       public int Id {get; set; }
       public int SerialNumber{ get; set; }
  
       //this starts the trouble, I actually want to interact with the Manufactureres table -&gt; Name column
       public int ManufacturerId { get; set; }  
   }
  </code></pre>
  
  <p>View (Create.cshtml):</p>
  
  <pre><code> ...
   //What i really want is a dropdown of the values in the Manufactureres table
   @Html.EditorFor(model=&gt; model.ManufacturerId)
  </code></pre>
  
  <p>This must be a farely common issue when using a relational database there would be many foreign key relationships to be used/shown, but for some reason i can't find a tutorial or issue on stackoverflow that directly corresponds to something so simple.  Any guidance, or direction is much appreciated!
  Thanks,</p>