Navigation:  StyleCop 4.3 > StyleCop 4.3 Rules > Readability Rules >

SA1102: QueryClauseMustFollowPreviousClause

Previous pageReturn to chapter overviewNext page
StyleCop 4.3

Send comments on this topic.

SA1102: QueryClauseMustFollowPreviousClause

Glossary Item Box

TypeName
QueryClauseMustFollowPreviousClause

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.

 


© Microsoft Corporation. All Rights Reserved.