C# 6.0 and onwards gives you the Null Propagating Operator MSDN Guide — like many of the other languages here, you would use it something like:
var customerName = orders?.customer?.name;
This can be combined with the null coalescing operator, to give a default value:
var customerName = orders?.customer?.name ?? "No value found.";
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.