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

SA1103: QueryClausesMustBeOnSeparateLinesOrAllOnOneLine

Previous pageReturn to chapter overviewNext page
StyleCop 4.3

Send comments on this topic.

SA1103: QueryClausesMustBeOnSeparateLinesOrAllOnOneLine
Glossary Item Box
TypeName

QueryClausesMustBeOnSeparateLinesOrAllOnOneLine

CheckId

SA1103

Category

Readability Rules

 

Cause

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.

Rule Description

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 = 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 all clauses are placed together on the same line, or each clause begins on its own line.

 


© Microsoft Corporation. All Rights Reserved.