Just a question in general... I'm fine with using the longhand version but from an academic viewpoint, I'm curious...
Why does the shorthand ?: not compile. It does not know how to convert lambda expression to lambda expression.
Func<int> idProp = (personIdProperty == null) ?
() => Person.UserAccountId :
() => Person.Id;
However, when I break it out into longhand, it works just fine.
Func<int> idProp;
if (personIdProperty == null)
idProp = () => Person.UserAccountId;
else
idProp = () => Person.Id;
Thanks in advance.