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

SA1104: QueryClauseMustBeginOnNewLineWhenPreviousClauseSpansMultipleLines

Previous pageReturn to chapter overviewNext page
StyleCop 4.3

Send comments on this topic.

SA1104: QueryClauseMustBeginOnNewLineWhenPreviousClauseSpansMultipleLines
Glossary Item Box
TypeName

QueryClauseMustBeginOnNewLineWhenPreviousClauseSpansMultipleLines

CheckId

SA1104

Category

Readability Rules

 

Cause

A clause within a C# query expression begins on the same line as the previous clause, when the previous clause spans across multiple lines.

Rule Description

A violation of this rule occurs when a query clause spans across multiple lines, and the next clause begins on the same line as the end of the previous clause.

  object x =

      select a

      in b.GetCustomers(

           2, “x”) from c;

 

The query clause can correctly be written as:

  object x =

      select a

      in b.GetCustomers(

           2, “x”)

      from c;

 

How to Fix Violations

To fix a violation of this rule, move the clause down to start on the next line.

 


© Microsoft Corporation. All Rights Reserved.