title: Lambda "if" statement?
body: <p>I have 2 objects, both of which I want to convert to dictionarys. I use toDictionary&lt;>().</p>
  
  <p>The lambda expression for one object to get the key is (i => i.name). For the other, it's (i => i.inner.name). In the second one, i.name doesn't exist. i.inner.name ALWAYS exists if i.name doesn't.</p>
  
  <p>Is there a lambda expression I can use to combine these two? Basically to read as:</p>
  
  <p>"if i.name exists then set id to i.name, else set id to i.inner.name". </p>
  
  <p>Many thanks.</p>
  
  <p><strong>Update</strong></p>
  
  <p>When I say "don't exist", I mean the objects don't actually have the properties, not that the properties are just null. </p>