This is something you can quite easily find out for yourself...
Try the code as it stands ... it won't compile -
Quote:
Use of unassigned local variable 'UnitHeaderId'
So try changing it to
long UnitHeaderId = null;
It still won't compile
Quote:
Cannot convert null to 'long' because it is a non-nullable value type
Now try faking a means of getting
null
into the variable at run-time... this will compile
long UnitHeaderId;
long? x = null;
UnitHeaderId = (long)x;
if(UnitHeaderId != 0)
but as soon as you run it you get the runtime exception
Quote:
Nullable object must have a value.
So to answer your question, neither the IF nor the OR clause will be executed - if you somehow manage to get a null into
UnitHeaderId
you will get an exception thrown