C#

C#

Made by DeepSource

Consider replacing an if statement with just the condition if all it does is return a bool value CS-R1126

Anti-pattern
Major
Autofix

If all your ifstatement does is return a bool value in both the then and else blocks, consider replacing the entire if statement with just the condition.

Bad Practice

if (condition)
{
    return true;
else
{
    return false;
}

Recommended

return condition;