Skip to content

Commit 5de01ef

Browse files
authored
Fix typos in C# programming guide (#26805)
1 parent 2459c05 commit 5de01ef

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/csharp/programming-guide/classes-and-structs/partial-classes-and-methods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Any method that doesn't conform to all those restrictions (for example, `public
108108

109109
Partial methods enable the implementer of one part of a class to declare a method. The implementer of another part of the class can define that method. There are two scenarios where this is useful: templates that generate boilerplate code, and source generators.
110110

111-
- **Template code**: The template reserves a method name and signature so that generated code can call the method. These methods follows the restrictions that enable a developer to decide whether to implement the method. If the method is not implemented, then the compiler removes the method signature and all calls to the method. The calls to the method, including any results that would occur from evaluation of arguments in the calls, have no effect at run time. Therefore, any code in the partial class can freely use a partial method, even if the implementation is not supplied. No compile-time or run-time errors will result if the method is called but not implemented.
111+
- **Template code**: The template reserves a method name and signature so that generated code can call the method. These methods follow the restrictions that enable a developer to decide whether to implement the method. If the method is not implemented, then the compiler removes the method signature and all calls to the method. The calls to the method, including any results that would occur from evaluation of arguments in the calls, have no effect at run time. Therefore, any code in the partial class can freely use a partial method, even if the implementation is not supplied. No compile-time or run-time errors will result if the method is called but not implemented.
112112
- **Source generators**: Source generators provide an implementation for methods. The human developer can add the method declaration (often with attributes read by the source generator). The developer can write code that calls these methods. The source generator runs during compilation and provides the implementation. In this scenario, the restrictions for partial methods that may not be implemented often aren't followed.
113113

114114
```csharp

docs/csharp/programming-guide/concepts/linq/set-operations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ The [`IntersectBy`](xref:System.Linq.Enumerable.IntersectBy%2A?displayProperty=n
8585

8686
:::code source="snippets/set-operators/Program.IntersectBy.cs" id="Planets":::
8787

88-
There are two arrays of planets, one represents the first first planets from the sun and the second represents the last five planets from the sun. Since the `Planet` type is a positional `record` type, you can use its value comparison semantics in the form of the `keySelector`:
88+
There are two arrays of planets, one represents the first five planets from the sun and the second represents the last five planets from the sun. Since the `Planet` type is a positional `record` type, you can use its value comparison semantics in the form of the `keySelector`:
8989

9090
:::code source="snippets/set-operators/Program.IntersectBy.cs" id="IntersectBy":::
9191

@@ -103,7 +103,7 @@ The following example depicts a union operation on two sequences of strings. The
103103

104104
[!code-csharp-interactive[Union](~/samples/snippets/csharp/VS_Snippets_VBCSharp/CsLINQSetOperation/CS/SetOperation.cs#4)]
105105

106-
The [`UnionBy`](xref:System.Linq.Enumerable.UnionBy%2A?displayProperty=nameWithType)is an alternative approach to `Union`, which takes two sequences of the same type and a `keySelector`. The `keySelector` is used as the comparative discriminator of the source type. Consider the following planet arrays:
106+
The [`UnionBy`](xref:System.Linq.Enumerable.UnionBy%2A?displayProperty=nameWithType) is an alternative approach to `Union`, which takes two sequences of the same type and a `keySelector`. The `keySelector` is used as the comparative discriminator of the source type. Consider the following planet arrays:
107107

108108
:::code source="snippets/set-operators/Program.UnionBy.cs" id="Planets":::
109109

0 commit comments

Comments
 (0)