C#

C#

Made by DeepSource

Consider simplifying lambda when its body has a single statement CS-R1085

Anti-pattern
Major
Autofix

If your lambda's body has a single statement, consider refactoring it to move away from block syntax to expression body. Doing so makes your code easier to read.

Bad Practice

var square = (int x) =>
{
    return x * x;
};

Recommended

var square = (int x) => x * x;