title: ASP.NET MVC: Set parent foreign key while creating a child entity
body: <p>I have:</p>
  
  <p>"Task" Entity that holds a foreignkey to a "Project" Entity.
  In the MVC model I have a ProjectDetails view where i have a ActionLink for creating a new Task</p>
  
  <p>I need to set the ProjectReference for the new Task object.
  The projectReference is passed by a url parameter (<code>CreateTask?projectId=4</code>)</p>
  
  <p>In the projectDetails view I have:</p>
  
  <pre><code>&lt;%= Html.ActionLink("Create New Task", "CreateTask", new {???Set the ProjectID???  })%&gt;
  </code></pre>
  
  <p>1) How to set the ProjectReference "ProjectID"?</p>
  
  <p>2) Is using <code>ViewContext.Controller.ValueProvider["id"].RawValue</code> for getting the urlparameter good?</p>
  
  <p>Thank you!!</p>