title: One-to-many dropdownlist suggestion
body: <p>I'm having hard time trying to figure out which way to go.
  Before i start, here some of the classes :</p>
  
  <pre><code>public class Car
  {
      [Key]
      [Required]
      [DatabaseGenerated(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.Identity)]
      public int ID { get; set; }
  
      [Required]
      [MaxLength(255)]
      public string Title { get; set; }
  
      [Required]
      public DateTime Date{ get; set; }
  
      public virtual Category Category { get; set; }   
  }
  
  public class Category {
      [Key]
      [Required]
      [DatabaseGenerated(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.Identity)]
      public int ID {get;set;}
  
      public Category Parent{get;set;}
  
      [Required]
      [MaxLength(255)]
      public string Title {get;set;}
  }
  </code></pre>
  
  <p>So, to create a new "Car", I simply need a page with a dropdown for all of the categories. To do that, I wrote a new class and passed it to "ActionResult Create"...</p>
  
  <p>Here it is :</p>
  
  <pre><code>public class CarCreate
  {
      public Car Car { get; set; }
      public List&lt;Category&gt; Categories
      {
          get
          {
              List&lt;Category&gt; list = new List&lt;Category&gt;();
  
              SystemContext sc = new SystemContext();
  
              list = sc.Categories.ToList();
              list.Insert(0, null);
  
              sc.Dispose();
  
              return list;
          }
      }
  }
  </code></pre>
  
  <p>And from the controller I passed it like this:</p>
  
  <pre><code>    public ActionResult Create()
      {
          return View(new CarCreate());
      }
  </code></pre>
  
  <p>And within the view, I created a dropdown for List in CarCreate class:</p>
  
  <pre><code> &lt;div class="col-md-4"&gt;
          @Html.LabelFor(t =&gt; t.Car.Title)
          @Html.TextBoxFor(model =&gt; model.Car.Title, new { @class = "form-control" })
      &lt;/div&gt;
  
    &lt;div class="col-md-4"&gt;
          @Html.LabelFor(t =&gt; t.Car.Category)
          @Html.DropDownListFor(model =&gt; model.Car.Category, new SelectList(Model.Categories, "ID", "Title","Select"), new { @class = "form-control" })
      &lt;/div&gt;
  </code></pre>
  
  <p>And when I check the Car.Category within the ActionResult that handles postback like this:</p>
  
  <pre><code>    [HttpPost]
      [ValidateAntiForgeryToken]
      public ActionResult Create(CarCreate emc)
      {
         Response.Write(emc.Car.Title);
          Response.Write(emc.Car.Category== null ? "null" : "notnull");
          return View(new CarCreate());
      }
  </code></pre>
  
  <p>I can get title. But category is always null.</p>
  
  <p>What would I have to do to get category from postback?</p>