I am using this solution to do a chained null check in my code
Cleaner way to do a null check in C#?
I was just wondering cant we make it like this.
bool returnValue = Helper.IsNull(nullPerson.contact.address.city);
Wouldn't that be even more cleaner ?
I tried writing such a generic function
public static bool IsNull<T>(this T rootObj)
{
var visitor = new IsNullExpressionVisitor();
//...
//...
}
but then I got stuck on how to make expression out of this rootObject.