I have 2 objects, both of which I want to convert to dictionarys. I use toDictionary<>().
The lambda expression for one object to get the key is (i => i.name). For th
Yes, the conditional operator ("ternary operator") does what you want:
(i => i.name != null ? i.name : i.inner.name)
Assuming, of course, that you can detect the "existence" of the name by checking for null.
null
Edit: In that case, Kirschstein's answer is better, of course.