Skip to content

Latest commit

 

History

History
59 lines (47 loc) · 1.21 KB

SA1102.md

File metadata and controls

59 lines (47 loc) · 1.21 KB

SA1102

Title Query clause should follow previous clause
TypeName SA110xQueryClauses
CheckId SA1102
Category Readability Rules

Cause

A C# query clause does not begin on the same line as the previous clause, or on the next line.

Rule description

A violation of this rule occurs when a clause within a query expression does not begin on the same line as the previous clause, or on the line after the query clause. For example:

    object x = select a in b

        from c;

The query clause can correctly be written as:

    object x = select a in b from c;

or:

    object x =
        select a
        in b
        from c;

How to fix violations

To fix a violation of this rule, ensure that each clause in the query expression begins on the same line as the previous clause, or on the following line.

How to suppress violations

#pragma warning disable SA1102 // Query clause should follow previous clause
    object x = select a in b

        from c;
#pragma warning restore SA1102 // Query clause should follow previous clause