Possible Duplicate:
Is relying on && short-circuiting safe in .NET?
I wasn’t sure how to phrase the title of the question correctly, but it’s very simple to explain with a single line of code:
if (someObject == null || someObject.someProperty)
...
Can I do that? Or this one:
if (someObject != null && someObject.someProperty)
...
Yes, this is safe.
||and&&are short-circuiting operators. From the MSDN Library: