Title | Query clauses should be on separate lines or all on one line |
TypeName | SA110xQueryClauses |
CheckId | SA1103 |
Category | Readability Rules |
The clauses within a C# query expression are not all placed on the same line, and each clause is not placed on its own line.
A violation of this rule occurs when the query clauses are not either placed all on the same line, or each on its own line. For example:
object x = from num in numbers
select num;
The query clauses can correctly be written as:
object x = from num in numbers select num;
or:
object x =
from num in numbers
select num;
To fix a violation of this rule, ensure that all clauses are placed together on the same line, or each clause begins on its own line.
#pragma warning disable SA1103 // Query clauses should be on separate lines or all on one line
object x = from num in numbers
select num;
#pragma warning restore SA1103 // Query clauses should be on separate lines or all on one line