Is there any better way to code razor cshtml that checks for null for nested object so it wont throw null exception error on the container object if the container is null. For example :
page.cshtml
Hello @obj1.obj2.prop3
will throw error if obj1 is null or obj1.prop3is null, but
Hello @Html.DisplayFor(m => obj1.obj2.prop3)
can check for null on obj1 or obj1.obj2 so it won't throw error
Hello @(obj1 == null? "" : (obj1.obj2 == null? "" : obj1.obj2.prop3))
is just too lengthy