title: Only return selected fields in Web API results
body: <p>First of all, this is not exactly a duplication of the dozens of other posts and I have tried all of them and none of them work. </p>
  
  <p>I have a model that contains many more values than my web api consumers need.</p>
  
  <pre><code>public class Publication
  {
      [Key]
      public int PublicationID { get; set; }
      public string PublicationTitle { get; set; }
      public string Frequency { get; set; }
      public DateTime NextIssueDate { get; set; }
      public DateTime SpaceDeadline { get; set; }
      public DateTime MaterialsDeadline { get; set; }
      public DateTime CreatedDt { get; set; }
      public string CreatedBy { get; set; }
      public DateTime UpdatedDt { get; set; }
      public string UpdatedBy { get; set; }
  }
  </code></pre>
  
  <p>I only want say a few of the fields to be passed in the API.  I've tried this code but instead of leaving out say UpdateBy in the Json result, it returns it with a null value.  How do I get rid of that?  I've tried several dozen variations but they either fail to compile or fail to return results.</p>
  
  <pre><code>    public IQueryable&lt;Publication&gt; GetPublications()
      {
          return db.Publications
              .ToList()
              .Select(p =&gt; new Publication {
                  PublicationID = p.PublicationID,
                  PublicationTitle = p.PublicationTitle,
                  Frequency = p.Frequency,
                  NextIssueDate = p.NextIssueDate
              })
              .AsQueryable();
      }
  </code></pre>