title: Include properties based on conditions in anonymous types
body: <p>Supposing I have the following anonymous type</p>
  
  <pre><code>var g = records.Select(r =&gt; new
  {                    
      Id = r.CardholderNo,
      TimeIn = r.ArriveTime,
      TimeOut = r.LeaveTime,
  });
  </code></pre>
  
  <p>Is it possible to do something like the following:</p>
  
  <pre><code>var g = records.Select(r =&gt; new
  {                    
      Id = r.CardholderNo,
      if (condition) 
      {
          TimeIn = r.ArriveTime;
      },
      TimeOut = r.LeaveTime,
      //many more properties that I'd like to be dependant on conditions.
  });
  </code></pre>
  
  <p>How can I achieve an anonymous type based on conditions? </p>