Skip to content

Commit

Permalink
Merge pull request #3755 from arphox/docs/fix_SA1102_code_examples
Browse files Browse the repository at this point in the history
Update documentation for SA1102 to contain compilable code examples
  • Loading branch information
sharwell committed Dec 18, 2023
2 parents e22309f + 515ac83 commit fbcb53b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions documentation/SA1102.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ A C# query clause does not begin on the same line as the previous clause, or on

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:
```c#
object x = select a in b
object x = from num in numbers

from c;
select num;
```

The query clause can correctly be written as:
```c#
object x = select a in b from c;
object x = from num in numbers select num;
```
or:
```c#
object x =
select a
in b
from c;
from num
in numbers
select num;
```

## How to fix violations
Expand All @@ -52,8 +52,8 @@ To fix a violation of this rule, ensure that each clause in the query expression

```c#
#pragma warning disable SA1102 // Query clause should follow previous clause
object x = select a in b
object x = from num in numbers

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

0 comments on commit fbcb53b

Please sign in to comment.