title: MVC4 Stored Procedure returns results, but MVC shows the lookup field values are null
body: <p>My proc returns all results but MVC is showing the lookups are null.</p>
  
  <p>I have a VIEW where the "grid" for loop looks like this:</p>
  
  <pre><code>@foreach (var item in Model) {
      &lt;tr&gt;
          &lt;td&gt;@Html.ActionLink(item.Headline, "ViewDetails", "Advisory", new { id=item.AdvisoryId }, "")&lt;/td&gt;
          &lt;td&gt;@item.AdvisoryStartDate.ToShortDateString()&lt;/td&gt;
          &lt;td&gt;@item.AdvisoryType.AdvisoryType&lt;/td&gt;
          &lt;td&gt;@item.AdvisoryProvider.AdvisoryProvider&lt;/td&gt;
          &lt;td&gt;@item.AdvisoryCategory.AdvisoryCategory&lt;/td&gt;         
      &lt;/tr&gt;
  }
  </code></pre>
  
  <p>The last three fields are lookups.  I initially populated this with this controller call:</p>
  
  <pre><code>var advisories = db.Advisories.Include(i =&gt; i.AdvisoryType)
              .Include(i =&gt; i.AdvisoryProvider)
              .Include(i =&gt; i.AdvisoryCategory)
              .OrderByDescending(i =&gt; i.AdvisoryStartDate);
          ViewData["Advisories"] = advisories;
  </code></pre>
  
  <p>But I've now replaced that with this proc call (because I need to get "advisories" the user hasn't seen yet, so it's more complicated than the above, which is basically "get all"; I also need to query the DB by UserID whereas MVC only has User.Identity.Name): </p>
  
  <pre><code>var results = db.Database.SqlQuery&lt;Advisory&gt;("EXEC [ponzi].[uspUserAdvisories] {0}",  User.Identity.Name).ToList();
  ViewData["Advisories"] = results;
  </code></pre>
  
  <p>I know the proc returns all results (when I run it in SQL Server), but in MVC, when I mouse over "results", the AdvisoryCategoryID is filled in but AdvisoryCategory is null.  Same with the other two lookups.  I assume it's because AdvisoryCategoryID is in my Advisory model, but AdvisoryCategory is from the AdvisoryCategory model.</p>
  
  <p>Here is the relevant part of the Advisory model:</p>
  
  <pre><code>[Key]
      [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
      public int AdvisoryId { get; set; }
  
      public virtual int AdvisoryTypeID { get; set; }
      public virtual AdvisoryTypes AdvisoryType { get; set; }
  
      public virtual AdvisoryProviders AdvisoryProvider { get; set; }
      public virtual int AdvisoryProviderID { get; set; }
  
      public virtual AdvisoryCategories AdvisoryCategory { get; set; }
      public virtual int AdvisoryCategoryID { get; set; }
  </code></pre>
  
  <p>How can I get these three lookup fields to show the data returned by the proc? Thanks.</p>