I wonder if it is possible to rewrite the following method using an expression-bodied member:
private void Checkup()
{
if (errorCondition) throw new InvalidOperationException("Error");
}
I wonder if it is possible to rewrite the following method using an expression-bodied member:
private void Checkup()
{
if (errorCondition) throw new InvalidOperationException("Error");
}
Maybe I have found a solution:
void Checkup() => _ = condition ? throw new InvalidOperationException("Error") : 0;