title: How to ignore object property on .GET but allow it on .POST?
body: <p>I have the following object in my c# web api project:</p>
  <pre><code>public class InfoUtente
  {
      public string nome { get; set; }
      public string cognome { get; set; }
      public string cellulare { get; set; }
      public string email { get; set; }
      public bool termini { get; set; }
      public string fidelity { get; set; }
  
      public InfoUtente() { }
      public InfoUtente(string nome, string cognome, string cellulare, string email, string fidelity)
      {
          this.nome = nome;
          this.cognome = cognome;
          this.cellulare = cellulare;
          this.email = email;
          this.fidelity = fidelity;
      }
  }
  </code></pre>
  <p>When a <code>.POST</code> call is made to the server <code>InfoUtente</code> is posted and in this case i should <strong>ignore</strong> the <code>fidelity</code> property and allow <code>termini</code></p>
  <p>while when the user request the data with a <code>.GET</code> request i should return the whole object with <code>fidelity</code> but without <code>termini</code>.</p>
  <p>I'm using the default serializator (JSON.NET), and i've tryed to use <code>JsonIgnore</code> on <code>termini</code> and in a <code>.GET</code> call it returns the right json without <code>termini</code> but if i try to make a <code>.POST</code> of <code>InfoUtente</code> with <code>JsonIgnore</code> on <code>termini</code> property, it will be ignored in .POST too and it's value will be set to false in any case..</p>
  <p>So i should be able to <code>.POST</code> a JSON with</p>
  <pre><code>nome,cognome,cellulare,email,termini
  </code></pre>
  <p>and be able to <code>.GET</code> it with</p>
  <pre><code>nome,cognome,cellulare,email,fidelity
  </code></pre>
  <p>Should i make two different objects one with <code>termini</code> and without <code>fidelity</code> to use in <code>.POST</code> and another without <code>termini</code> and with <code>fidelity</code> to <code>.GET</code> or i could achieve it by using only one object?</p>