Add ability to coalesce using a property instead of a constant

Description

Right now, NHibernate doesn't support things like this:

Instead, I have to write something as ridiculous as

which is, of course, not fun. See my StackOverflow question for details and a workaround.

I'm willing to submit a pull request along with a test, but there's a catch: as it is, I can't really just add another Coalesce() overload because it would have exactly the same signature. Of course, I could just give it another name, but what name would be good? IfNull(), like in the StackOverflow answer? IfNullThen()? OrElse()?

Or maybe there is another way to resolve the signature conflict? I thought about using an expression, like Coalesce(() => anotherAlias.AnotherProperty), but due to the lack of experience with C# I couldn't write expression processing code for that. And besides, it's too verbose.

Environment

None

Assignee

Alex Zaytsev

Reporter

Sergey A. Tachenov

Labels

Components

Fix versions

Affects versions

Priority

Trivial
Configure