title: Add to Collection if Not Null
body: <p>I have a very large object with many nullable-type variables. I also have a dictionary which I want to fill up with this object's non-null variables.</p>
  
  <p>The code will look something like this</p>
  
  <pre><code>if (myObject.whatever != null)
  {
  myDictionary.Add("...",myObject.whatever);
  }
  if (myObject.somethingElse != null)
  {
  myDictionary.Add("...",myObject.somethingElse);
  
  ...
  </code></pre>
  
  <p>EDIT (Sorry messed up the code)</p>
  
  <p>When we repeat this for the umpteenth time we get a mess of very long code. Is there some shorter way I could write this mess? I know about the Conditional Operator (aka ?) but that's just for assignments. Is there something like that for adding to a collection?</p>