title: conditionally ignore property serialization
body: <p>I have a Asp.Net WebApi project and I want to return a list of product in Json format and one specific product.</p>
  
  <p>This is my product model:</p>
  
  <pre><code>public class Product
  {
     public int Id { get; set; }
     public string ShortString { get; set; }
     public string LongString { get; set; } 
  }
  </code></pre>
  
  <p>And this is my ApiController:</p>
  
  <pre><code>public class ProductController : ApiController
  {
  
       public IQueryable&lt;Product&gt; Get()
       {
          return Context.Products;
       }
  
       public IHttpActionResult Get(int id)
       {
          var p = Context.Products.FirstOrDefault(m =&gt; m.Id == id);
  
          if (p == null)
              return NotFound();
  
          return Ok(p);
       }
   }
  </code></pre>
  
  <p>I want to return <code>LongString</code> field in the one specific product but not in the list of products. Is there any conditional <code>[JsonIgnore]</code> attribute in Json.Net library.</p>