Asked • 07/13/19

Does the ``??`` operator use shortcircuiting?

Does the `??` operator in C# use shortcircuiting when evaluating? var result = myObject ?? ExpressionWithSideEffects(); When ``myObject`` is non-null, the result of ``ExpressionWithSideEffects()`` is not used, but will ``ExpressionWithSideEffects()`` be skipped completely?

1 Expert Answer


Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.


Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.