Skip to content

Commit 97b80c9

Browse files
authored
Fix about.md typos (#2243)
1 parent eaa865b commit 97b80c9

File tree

11 files changed

+40
-17
lines changed

11 files changed

+40
-17
lines changed

concepts/const-readonly/about.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22

33
By default, values in C# are _mutable_, that is they can change over time. To make a value _immutable_, there are two options:
44

5-
1. Add the [`const` modifier](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/const)
6-
2. Add the [`readonly` modifier](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/readonly#readonly-field-example)
5+
1. Add the [`const` modifier][const-modifier].
6+
2. Add the [`readonly` modifier][readonly-modifier].
77

88
The `const` modifier has some restrictions:
99

1010
1. It can only be applied to "constant" types: strings, booleans and numbers.
1111
1. The `const` value must be initialized immediately.
1212

13-
See [definining constants](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/how-to-define-constants) for more information.
13+
See [defining constants][defining-constants] for more information.
1414

1515
If your value is a non-constant type or you need to initialize the value in a constructor, `readonly` can be used to enforce immutability.
16+
17+
[const-modifier]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/const
18+
[readonly-modifier]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/readonly#readonly-field-example
19+
[defining-constants]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/how-to-define-constants
20+

concepts/constants/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ To ensure that all members of a reference type are protected the fields can be m
6060

6161
You should examine [read-only collections][readonly-collections] in the Base Class Library.
6262

63-
For arrays the closest you can get to a read-only version is the [`Array.AsReadOnly<T>()][as-read-only] method.
63+
For arrays the closest you can get to a read-only version is the [`Array.AsReadOnly<T>()`][as-read-only] method.
6464

6565
[readonly-fields]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/readonly#readonly-field-example
6666
[constants]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/constants

concepts/enumerables/about.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# About
22

3-
Types that implement the [`IEnumerable<T>`](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1
3+
Types that implement the [`IEnumerable<T>`][IEnumerable] interface are known as being _enumerable_.
4+
All built-in collection types implement this interface.
45

56
An enumerable type can be iterated over using a `foreach` loop:
67

@@ -13,8 +14,12 @@ foreach (var prime in primes)
1314
// => 2357
1415
```
1516

16-
To implement `IEnumerable<T>`, a type has to implement one method: `IEnumerator<T> GetEnumerator()`. As seen, an enumerable defers the actual iterating over a collection to an `IEnumerator<T>` type. This interface has one property and three methods to implement:
17+
To implement `IEnumerable<T>`, a type has to implement one method: `IEnumerator<T> GetEnumerator()`.
18+
As seen, an enumerable defers the actual iterating over a collection to an `IEnumerator<T>` type.
19+
This interface has one property and three methods to implement:
1720

1821
- `public T Current { get; }`: get the current element.
1922
- `public bool MoveNext ();`: move to the next element, returning `true` if the move to the next element was successful, and `false` if not (no more elements).
2023
- `public void Reset ();`: reset the enumerator to its initial state (before the first element).
24+
25+
[IEnumerable]: https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1

concepts/flag-enums/about.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ features.HasFlag(PhoneFeatures.Call); // => false
5959
features.HasFlag(PhoneFeatures.Text); // => true
6060
```
6161

62-
The [working with enums as bit flags tutorial][docs.microsoft.com-enumeration-types-as-bit-flags] goes into more detail how to work with flag enums. Another great resource is the [enum flags and bitwise operators page][alanzucconi.com-enum-flags-and-bitwise-operators].
62+
The [working with enums as bit flags tutorial][docs.microsoft.com-enumeration-types-as-bit-flags] goes into more detail how to work with flag enums. Another great resource is the [enum flags and bitwise operators page][enum-lags].
6363

6464
By default, the `int` type is used for enum member values. One can use a different integer type by specifying the type in the enum declaration:
6565

@@ -78,3 +78,4 @@ enum PhoneFeatures : byte
7878
[bitwise-complement-operator]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#bitwise-complement-operator-
7979
[binary-literals]: https://riptutorial.com/csharp/example/6327/binary-literals
8080
[has-flag]: https://docs.microsoft.com/en-us/dotnet/api/system.enum.hasflag
81+
[enum-lags]: alanzucconi.com-enum-flags-and-bitwise-operators

concepts/parameters/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ When studying the documentation note that it uses the following terms:
6868

6969
Whilst `ref` is easy to use and has no performance penalties it is worth seeing how the problems it addresses are dealt with in a particular code base before using it widely. There are alternatives such as passing in by-value and using the value from the called method's return statement. Again, `tuples` can play a role.
7070

71-
You will see from the [documentation][ref-parameter] that `out` and `ref` cannot be used in certain situations but you can ignore them for now. The compiler will let you know whwn such situations arise.
71+
You will see from the [documentation][ref-parameter] that `out` and `ref` cannot be used in certain situations but you can ignore them for now. The compiler will let you know when such situations arise.
7272

7373
Note that `optional parameters` and `named arguments` are discussed in the `method-overloading` exercise.
7474

concepts/readonly-collections/about.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@ To ensure that all members of a reference type are protected the fields can be m
1616

1717
The Base Class Library (BCL) provides some readonly versions of collections where there is a requirement to stop members of a collections being updated. These come in the form of wrappers:
1818

19-
- [`ReadOnlyDictionary<T>`](https://docs.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.readonlydictionary-2
20-
- [`ReadOnlyCollection<T>`](https://docs.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.readonlycollection-1
19+
- [`ReadOnlyDictionary<T>`][ReadOnlyDictionary]
20+
- [`ReadOnlyCollection<T>`][ReadOnlyCollection]
21+
22+
[ReadOnlyDictionary]: https://docs.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.readonlydictionary-2
23+
[ReadOnlyCollection]: https://docs.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.readonlycollection-1

concepts/sets/about.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# About
22

3-
A set is a collection of unique values. The default .NET implementation of a set is the [`HashSet<T>`](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.hashset-1
3+
A set is a collection of unique values. The default .NET implementation of a set is the [`HashSet<T>`][HashSet].
44

5-
The `HashSet` class uses each element's [`GetHashCode()` method](https://docs.microsoft.com/en-us/dotnet/api/system.object.gethashcode
5+
The `HashSet` class uses each element's [`GetHashCode()` method][GetHashCode].
66

77
By default, the `GetHashCode()` implementation for reference types returns a hash of its memory location. This means that different reference type objects will have a different hash code (this is known as reference equality). Value types by default return a hash of their fields/properties. This means that different value type objects with the same field/property values will have the same hash code (this is known as structural equality).
88

99
You can override the `GetHashCode()` implementation on your own classes, which you could use to have a reference type have structural equality.
10+
11+
[HashSet]: https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.hashset-1
12+
[GetHashCode]: https://docs.microsoft.com/en-us/dotnet/api/system.object.gethashcode

concepts/structs/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ As a result of points 1 and 3 above there is no way for the developer of a `stru
4646

4747
## Common structs
4848

49-
You will see from the documentation that there is a close relationship between primitives and structs. See [`Int32/int]`][int32], for an example. A more conventional example of a`struct`is the type [`TimeSpan`][time-span].
49+
You will see from the documentation that there is a close relationship between primitives and structs. See [`Int32/int`][int32], for an example. A more conventional example of a`struct`is the type [`TimeSpan`][time-span].
5050

5151
Instances of `TimeSpan` behave much like numbers with comparison operators like `>` and `<` and arithmetic operators. You can implement these operators for your own `struct`s when you need them.
5252

concepts/switch-expressions/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ An "arm" of the `switch` is selected when the pattern matches the range variable
2929
Switch expression also support [type patterns][pattern-matching] and recursive matching.
3030

3131
[switch-expressions]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/switch-expression
32-
[switch-statement]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/switch
32+
[switch-statements]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/switch
3333
[pattern-matching]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/switch-expression#patterns-and-case-guards

concepts/time/about.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ In case you were wondering, according to this [Wikipedia article][wiki-utc] the
4242
[date-string-formatting]: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings
4343
[time-span]: https://docs.microsoft.com/en-us/dotnet/api/system.timespan
4444
[wiki-utc]: https://en.wikipedia.org/wiki/Coordinated_Universal_Time
45+
[time-zone-info]: https://learn.microsoft.com/en-us/dotnet/api/system.timezoneinfo
46+
[cross-platform-time-zones]: https://devblogs.microsoft.com/dotnet/cross-platform-time-zones-with-net-core/

concepts/timezone/about.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# About
22

3-
The [`TimeZoneInfo`](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo
3+
The [`TimeZoneInfo`][TimeZoneInfo] class provides routines for handling the differences between time zones. The `TimeZoneInfo` class also contains methods that facilitate dealing with daylight saving time.
44

5-
The [`CultureInfo`](https://docs.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo
5+
The [`CultureInfo`][CultureInfo] class supports locale dependent date time formats.
66

7-
To support cross-platform coding the [`RuntimeInformation`](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.runtimeinformation
7+
To support cross-platform coding the [`RuntimeInformation`][RuntimeInformation] class allows you to detect which operating system your code is executing on, Linux, Windows or OSX.
8+
9+
[TimeZoneInfo]: https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo
10+
[CultureInfo]: https://docs.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo
11+
[RuntimeInformation]: https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.runtimeinformation

0 commit comments

Comments
 (0)