Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation for SA1102 to contain compilable code examples #3755

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
```