Skip to content

Instantly share code, notes, and snippets.

@controlflow
Last active January 20, 2019 15:58
Show Gist options
  • Save controlflow/3f74c5b8ba8d40ba420856209296fc21 to your computer and use it in GitHub Desktop.
Save controlflow/3f74c5b8ba8d40ba420856209296fc21 to your computer and use it in GitHub Desktop.
var condition = expression.ConditionOperand;
if (condition == null) return;
var thenResult = expression.ThenResult;
if (thenResult == null) return;
var elseResult = expression.ElseResult;
if (elseResult == null) return;
// ...
if (condition is {
ConditionOperand is { } condition,
ThenResult is { } thenResult,
ElseResult is { } elseResult
})
{
// ...
}
if (condition is ({ } condition, { } thenResult, { } elseResult))
{
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment