Title | Query clauses spanning multiple lines should begin on own line |
TypeName | SA110xQueryClauses |
CheckId | SA1105 |
Category | Readability Rules |
A clause within a C# query expression spans across multiple lines, and does not begin on its own line.
A violation of this rule occurs when a query clause spans across multiple lines, but does not begin on its own line. For example:
var elementDescriptions =
from element in elements select GenerateElementDescription
(
element
);
The query clauses can correctly be written as:
var elementDescriptions =
from element in elements
select GenerateElementDescription
(
element
);
To fix a violation of this rule, move the clause down to start on the next line.
#pragma warning disable SA1105 // Query clauses spanning multiple lines should begin on own line
var elementDescriptions =
from element in elements select GenerateElementDescription
(
element
);
#pragma warning restore SA1105 // Query clauses spanning multiple lines should begin on own line