Why this matters
Expression-bodied members improve code conciseness and readability for simple properties and methods.
Ensure that simple methods and properties use expression-bodied syntax to improve code conciseness and readability.
Expression-bodied members improve code conciseness and readability for simple properties and methods.
Side-by-side examples engineers can pattern-match during review.
public int Property
{
get { return _property; }
}public int Property => _property;
public int Property
{
get { return _property; }
}public int Property => _property;
From the same buckets as this rule.
Check if loops use equality operators (== or !=) in termination conditions. These can lead to infinite loops if the condition is never met exactly. Instead, use relational operators like < or > for safer loop termination.