Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/csharp/codedoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Here's code for the simple math library:
The sample library supports four major arithmetic operations `add`, `subtract`, `multiply` and `divide` on `int` and `double` data types.

Now you want to be able to create an API reference document from your code for third party developers who use your library but don't have access to the source code.
As mentioned earlier XML documentation tags can be used to achieve this, You will now be introduced to the standard XML tags the C# compiler supports.
As mentioned earlier XML documentation tags can be used to achieve this. You will now be introduced to the standard XML tags the C# compiler supports.

### <summary>

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/discards.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Discards are particularly useful in working with tuples when your application co

For more information on deconstructing tuples with discards, see [Deconstructing tuples and other types](deconstruct.md#deconstructing-tuple-elements-with-discards).

The `Deconstruct` method of a class, structure, or interface also allows you to retrieve and deconstruct a specific set of data from an object. You can use discards when you are interested in working with only a subset of the deconstructed values. Ihe following example deconstructs a `Person` object into four strings (the first and last names, the city, and the state), but discards the last name and the state.
The `Deconstruct` method of a class, structure, or interface also allows you to retrieve and deconstruct a specific set of data from an object. You can use discards when you are interested in working with only a subset of the deconstructed values. The following example deconstructs a `Person` object into four strings (the first and last names, the city, and the state), but discards the last name and the state.

[!code-csharp[Class-discard](../../samples/snippets/csharp/programming-guide/deconstructing-tuples/class-discard1.cs)]

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/expression-trees-translating.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ same node can be reused whenever its needed.

Let's verify this by building a second visitor that walks the tree
of addition nodes and computes the result. You can do this by
making a couple modifications to the vistor that you've seen so
making a couple modifications to the visitor that you've seen so
far. In this new version, the visitor will return the partial sum
of the addition operation up to this point. For a constant expression,
that is simply the value of the constant expression. For an addition
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/how-to/modify-string-contents.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The following example shows how to replace a set of characters in a string. Firs
## Unsafe modifications to string

Using **unsafe** code, you can modify a string "in place" after it has been created. Unsafe code bypasses many of the features of .NET designed to minimize certain types of bugs in code. You need to use unsafe code to modify a string in place because the string class is designed as an **immutable** type. Once it has been created, its value does not change. Unsafe code circumvents this property by accessing and modifying the memory used by a `string` without using normal `string` methods.
The following example is provided for those rare situations where you want to modify a string in-place using unsafe code. The example shows how to use the `fixed` keyword. The `fixed` keyword prevents the garbage collector (GC) from moving the string object in memory while code accesses the memory using the unsafe pointer. It also demonstrates one possible side effect of unsafe operations on strings that results from the way that the C# compiler stores (interns) strings internally. In general, you shouldn't use this technique unless it is absolutely necessary. You can learn more in the articles on [unsafe](../language-reference/keywords/unsafe.md) and [fixed](../language-reference/keywords/fixed-statement.md). The API reference for <xref:System.String.Intern%2A> includes inforamtion on string interning.
The following example is provided for those rare situations where you want to modify a string in-place using unsafe code. The example shows how to use the `fixed` keyword. The `fixed` keyword prevents the garbage collector (GC) from moving the string object in memory while code accesses the memory using the unsafe pointer. It also demonstrates one possible side effect of unsafe operations on strings that results from the way that the C# compiler stores (interns) strings internally. In general, you shouldn't use this technique unless it is absolutely necessary. You can learn more in the articles on [unsafe](../language-reference/keywords/unsafe.md) and [fixed](../language-reference/keywords/fixed-statement.md). The API reference for <xref:System.String.Intern%2A> includes information on string interning.

[!code-csharp-interactive[unsafe ways to create a new string](../../../samples/snippets/csharp/how-to/strings/ModifyStrings.cs#7)]

Expand Down
4 changes: 2 additions & 2 deletions docs/csharp/indexers.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ of values.

## Indexer Syntax

You access an indexer through a variable name and square brackets . You place the indexer
You access an indexer through a variable name and square brackets. You place the indexer
arguments inside the brackets:

```csharp
Expand All @@ -40,7 +40,7 @@ for properties and for indexers. This analogy carries through most of the
syntax rules for indexers. Indexers can have any valid access modifiers
(public, protected internal, protected, internal, private or private protected). They may
be sealed, virtual, or abstract. As with properties, you can specify
different access modifiers for the get and set accesssors in an indexer.
different access modifiers for the get and set accessors in an indexer.
You may also specify read-only indexers (by omitting the set accessor),
or write-only indexers (by omitting the get accessor).

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/lambda-expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Ordinarily, the compiler uses type inference in determining parameter types. How

[!code-csharp[csSnippets.Lambdas](../../samples/snippets/csharp/concepts/lambda-expressions/expression3.cs#3)]

Note in the previous example that the body of an expression lambda can consist of a method call. However, if you are creating expression trees that are evaluated outside of the .NET Framework, such as in SQL Server or Entity Framework (EF), you should refrain from using method calls in lambda expressions, since the methods may have no meaning outside the context of the .NET implementation. If you do choose to use method calls in this case, be sure to test them thoroughly to ensure that the method calls can be successfuly resolved.
Note in the previous example that the body of an expression lambda can consist of a method call. However, if you are creating expression trees that are evaluated outside of the .NET Framework, such as in SQL Server or Entity Framework (EF), you should refrain from using method calls in lambda expressions, since the methods may have no meaning outside the context of the .NET implementation. If you do choose to use method calls in this case, be sure to test them thoroughly to ensure that the method calls can be successfully resolved.

## Statement lambdas ##

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/language-reference/compiler-messages/cs0016.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ ms.assetid: da62084c-7a18-4858-9034-d1fe099bf34c
# Compiler Error CS0016
Could not write to output file 'file' — 'reason'

The compiler could not write to an output file. Check the path to the file to make sure it exists. If a previously built file is already at the location, make sure it is writeable, and that no process currently has a lock on the file. For example,make sure your executable is not running when you attempt to build.
The compiler could not write to an output file. Check the path to the file to make sure it exists. If a previously built file is already at the location, make sure it is writeable, and that no process currently has a lock on the file. For example, make sure your executable is not running when you attempt to build.
2 changes: 1 addition & 1 deletion docs/csharp/language-reference/compiler-messages/cs0050.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Inconsistent accessibility: return type 'type' is less accessible than method 'm
The return type and each of the types referenced in the formal parameter list of a method must be at least as accessible as the method itself. For more information, see [Access Modifiers](../../../csharp/programming-guide/classes-and-structs/access-modifiers.md).

## Example
The following sample generates CS0050 because no accessiblity modifier is supplied for `MyClass` and its accessibility therefore defaults to `private`.
The following sample generates CS0050 because no accessibility modifier is supplied for `MyClass` and its accessibility therefore defaults to `private`.

```csharp
// CS0050.cs
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/language-reference/compiler-messages/cs0467.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ helpviewer_keywords:
ms.assetid: ae082998-afd6-4f82-9c87-6b429ba8fd57
---
# Compiler Warning (level 2) CS0467
Ambiguity between method 'method' and non-method 'non-method'.Using method group.
Ambiguity between method 'method' and non-method 'non-method'. Using method group.

Inherited members from different interfaces that have the same signature cause an ambiguity error.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ To specify multiple mapped source paths, separate each with a comma.

## Remarks

The compiler writes the source path path into its output for the following reasons:
The compiler writes the source path into its output for the following reasons:

1. The source path is substituted for an argument when the <xref:System.Runtime.CompilerServices.CallerFilePathAttribute> is applied to an optional parameter.
1. The source path is embedded in a PDB file.
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/language-reference/keywords/async.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ You specify `Task<TResult>` as the return type of an async method if the [return

You use the `void` return type primarily to define event handlers, which require that return type. The caller of a `void`-returning async method can't await it and can't catch exceptions that the method throws.

Starting with C# 7.0, you return another type, typically a value type, that has a `GetAwaiter` method to miminize memory allocations in performance-critical sections of code.
Starting with C# 7.0, you return another type, typically a value type, that has a `GetAwaiter` method to minimize memory allocations in performance-critical sections of code.

For more information and examples, see [Async Return Types](../../../csharp/programming-guide/concepts/async/async-return-types.md).

Expand Down
4 changes: 2 additions & 2 deletions docs/csharp/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ The following example defines a class (which is a reference type) named `SampleR
<a name="byref"></a>
### Passing parameters by reference ###

You pass a parameter by reference when you want to change the value of an argument in a method and want to refect that change when control returns to the calling method. To pass a parameter by reference, you use the [`ref`](language-reference/keywords/ref.md) or [`out`](language-reference/keywords/out-parameter-modifier.md) keyword. You can also pass a value by reference to avoid copying but still prevent modifications using the [`in`](language-reference/keywords/in-parameter-modifier.md) keyword.
You pass a parameter by reference when you want to change the value of an argument in a method and want to reflect that change when control returns to the calling method. To pass a parameter by reference, you use the [`ref`](language-reference/keywords/ref.md) or [`out`](language-reference/keywords/out-parameter-modifier.md) keyword. You can also pass a value by reference to avoid copying but still prevent modifications using the [`in`](language-reference/keywords/in-parameter-modifier.md) keyword.

The following example is identical to the previous one, except the value is passed by reference to the `ModifyValue` method. When the value of the parameter is modified in the `ModifyValue` method, the change in value is reflected when control returns to the caller.

Expand All @@ -123,7 +123,7 @@ Passing a reference-type parameter allows you to change the value of the referen
<a name="paramarray"></a>
### Parameter arrays ###

Sometimes, the requirement that you specify the exact number of arguments to your method is restrictive. By using the `params` keyword to indicate that a parameter is a parameter array, you allow your method to be called with a variable number of arguments. The parameter tagged with the `params` keyword must must be an array type, and it must be the last parameter in the method's parameter list.
Sometimes, the requirement that you specify the exact number of arguments to your method is restrictive. By using the `params` keyword to indicate that a parameter is a parameter array, you allow your method to be called with a variable number of arguments. The parameter tagged with the `params` keyword must be an array type, and it must be the last parameter in the method's parameter list.

A caller can then invoke the method in either of three ways:

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/modern-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ its functionality for any class derived from `EventArgs`. That
functionality is easier to create in a specific derived class. That
effectively means that deriving from System.EventArgs is a constraint
that limits your designs, but does not provide any additional benefit.
In fact, you can changes the definitions of `FileFoundArgs` and
In fact, you can change the definitions of `FileFoundArgs` and
`SearchDirectoryArgs` so that they do not derive from `EventArgs`.
The program will work exactly the same.

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ms.assetid: aa8732d7-5cd0-46e1-994a-78017f20d861
# Versioning in C# #

In this tutorial you'll learn what versioning means in .NET. You'll also learn the factors to consider when versioning your library as well as upgrading
to a new version of the a library.
to a new version of a library.

## Authoring Libraries

Expand Down