Possible Duplicates:
Deep Null checking, is there a better way?
C# elegant way to check if a property's property is null
i have to do a lookup in a deep object model like this:
p.OrganisationalUnit.Parent.Head.CurrentAllocation.Person;
is there anyway to evalute this and return null if any of the chain is null (organizationalunit, parent, head, etc), without having to do a
if (p.org == null && p.org.Parent == null && p.org.Parent.Head . . .