From e34216c58ab7d060bc68ec40d3f464e83805dd17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD?= Date: Tue, 14 Sep 2021 20:57:45 +0200 Subject: [PATCH 1/8] ProgrammingGuideClassesAndStructsFinalizers --- docs/csharp/fundamentals/object-oriented/objects.md | 2 +- docs/csharp/fundamentals/tutorials/inheritance.md | 2 +- docs/csharp/language-reference/builtin-types/struct.md | 2 +- docs/csharp/language-reference/keywords/class.md | 2 +- .../operators/bitwise-and-shift-operators.md | 2 +- docs/csharp/misc/cs0245.md | 2 +- docs/csharp/misc/cs0250.md | 2 +- .../classes-and-structs/{destructors.md => finalizers.md} | 6 +++--- .../snippets/{destructors => finalizers}/Program.cs | 0 .../expr-bodied-finalizer.cs} | 2 +- .../destructors.csproj => finalizers/finalizers.csproj} | 0 .../expression-bodied-members.md | 4 ++-- docs/csharp/toc.yml | 2 +- docs/csharp/tour-of-csharp/program-building-blocks.md | 2 +- docs/framework/performance/performance-tips.md | 6 +++--- docs/standard/garbage-collection/implementing-dispose.md | 2 +- docs/standard/garbage-collection/unmanaged.md | 2 +- 17 files changed, 20 insertions(+), 20 deletions(-) rename docs/csharp/programming-guide/classes-and-structs/{destructors.md => finalizers.md} (96%) rename docs/csharp/programming-guide/classes-and-structs/snippets/{destructors => finalizers}/Program.cs (100%) rename docs/csharp/programming-guide/classes-and-structs/snippets/{destructors/expr-bodied-destructor.cs => finalizers/expr-bodied-finalizer.cs} (80%) rename docs/csharp/programming-guide/classes-and-structs/snippets/{destructors/destructors.csproj => finalizers/finalizers.csproj} (100%) diff --git a/docs/csharp/fundamentals/object-oriented/objects.md b/docs/csharp/fundamentals/object-oriented/objects.md index d2fdd5bb45a6b..9b2dd20b85d8f 100644 --- a/docs/csharp/fundamentals/object-oriented/objects.md +++ b/docs/csharp/fundamentals/object-oriented/objects.md @@ -49,7 +49,7 @@ For more information: - [Classes](../types/classes.md) - [Constructors](../../programming-guide/classes-and-structs/constructors.md) -- [Finalizers](../../programming-guide/classes-and-structs/destructors.md) +- [Finalizers](../../programming-guide/classes-and-structs/finalizers.md) - [Events](../../programming-guide/events/index.md) - [object](../../language-reference/builtin-types/reference-types.md) - [Inheritance](./inheritance.md) diff --git a/docs/csharp/fundamentals/tutorials/inheritance.md b/docs/csharp/fundamentals/tutorials/inheritance.md index e6eb400f16a5e..606c2bca7921d 100644 --- a/docs/csharp/fundamentals/tutorials/inheritance.md +++ b/docs/csharp/fundamentals/tutorials/inheritance.md @@ -37,7 +37,7 @@ Not all members of a base class are inherited by derived classes. The following - [Instance constructors](../../programming-guide/classes-and-structs/constructors.md), which you call to create a new instance of the class. Each class must define its own constructors. -- [Finalizers](../../programming-guide/classes-and-structs/destructors.md), which are called by the runtime's garbage collector to destroy instances of a class. +- [Finalizers](../../programming-guide/classes-and-structs/finalizers.md), which are called by the runtime's garbage collector to destroy instances of a class. While all other members of a base class are inherited by derived classes, whether they are visible or not depends on their accessibility. A member's accessibility affects its visibility for derived classes as follows: diff --git a/docs/csharp/language-reference/builtin-types/struct.md b/docs/csharp/language-reference/builtin-types/struct.md index eb3ff579411ba..b2c5e164262d8 100644 --- a/docs/csharp/language-reference/builtin-types/struct.md +++ b/docs/csharp/language-reference/builtin-types/struct.md @@ -83,7 +83,7 @@ When you design a structure type, you have the same capabilities as with a [clas - A structure type can't inherit from other class or structure type and it can't be the base of a class. However, a structure type can implement [interfaces](../keywords/interface.md). -- You can't declare a [finalizer](../../programming-guide/classes-and-structs/destructors.md) within a structure type. +- You can't declare a [finalizer](../../programming-guide/classes-and-structs/finalizers.md) within a structure type. ## Instantiation of a structure type diff --git a/docs/csharp/language-reference/keywords/class.md b/docs/csharp/language-reference/keywords/class.md index 3b116021662d3..d14a901eb1d70 100644 --- a/docs/csharp/language-reference/keywords/class.md +++ b/docs/csharp/language-reference/keywords/class.md @@ -48,7 +48,7 @@ A class can contain declarations of the following members: - [Fields](../../programming-guide/classes-and-structs/fields.md) -- [Finalizers](../../programming-guide/classes-and-structs/destructors.md) +- [Finalizers](../../programming-guide/classes-and-structs/finalizers.md) - [Methods](../../programming-guide/classes-and-structs/methods.md) diff --git a/docs/csharp/language-reference/operators/bitwise-and-shift-operators.md b/docs/csharp/language-reference/operators/bitwise-and-shift-operators.md index 6408b8fa17872..59b67546f7be9 100644 --- a/docs/csharp/language-reference/operators/bitwise-and-shift-operators.md +++ b/docs/csharp/language-reference/operators/bitwise-and-shift-operators.md @@ -52,7 +52,7 @@ The `~` operator produces a bitwise complement of its operand by reversing each [!code-csharp-interactive[bitwise NOT](snippets/shared/BitwiseAndShiftOperators.cs#BitwiseComplement)] -You can also use the `~` symbol to declare finalizers. For more information, see [Finalizers](../../programming-guide/classes-and-structs/destructors.md). +You can also use the `~` symbol to declare finalizers. For more information, see [Finalizers](../../programming-guide/classes-and-structs/finalizers.md). ## Left-shift operator \<\< diff --git a/docs/csharp/misc/cs0245.md b/docs/csharp/misc/cs0245.md index 88699e63b6db7..3881c1aeb9d3f 100644 --- a/docs/csharp/misc/cs0245.md +++ b/docs/csharp/misc/cs0245.md @@ -12,7 +12,7 @@ ms.assetid: 3f2beb2f-a510-4568-9d11-bb1f65066acd Destructors and object.Finalize cannot be called directly. Consider calling IDisposable.Dispose if available. - For more information, see [Programming Essentials for Garbage Collection](../../standard/garbage-collection/index.md) and [Destructors](../programming-guide/classes-and-structs/destructors.md). + For more information, see [Programming Essentials for Garbage Collection](../../standard/garbage-collection/index.md) and [Finalizers](../programming-guide/classes-and-structs/finalizers.md). The following sample generates CS0245: diff --git a/docs/csharp/misc/cs0250.md b/docs/csharp/misc/cs0250.md index 9895db84208e8..47edc697d1559 100644 --- a/docs/csharp/misc/cs0250.md +++ b/docs/csharp/misc/cs0250.md @@ -14,7 +14,7 @@ Do not directly call your base class Finalize method. It is called automatically A program cannot attempt to force cleanup of base class resources. - See [Finalizers](../programming-guide/classes-and-structs/destructors.md) for more information. + See [Finalizers](../programming-guide/classes-and-structs/finalizers.md) for more information. The following sample generates CS0250 diff --git a/docs/csharp/programming-guide/classes-and-structs/destructors.md b/docs/csharp/programming-guide/classes-and-structs/finalizers.md similarity index 96% rename from docs/csharp/programming-guide/classes-and-structs/destructors.md rename to docs/csharp/programming-guide/classes-and-structs/finalizers.md index 0139be13e7d3e..7c48d8b70a7de 100644 --- a/docs/csharp/programming-guide/classes-and-structs/destructors.md +++ b/docs/csharp/programming-guide/classes-and-structs/finalizers.md @@ -21,11 +21,11 @@ Finalizers (historically referred to as **destructors**) are used to perform any For example, the following is a declaration of a finalizer for the `Car` class. -:::code language="csharp" source="snippets/destructors/Program.cs" ID="Snippet2"::: +:::code language="csharp" source="snippets/finalizers/Program.cs" ID="Snippet2"::: A finalizer can also be implemented as an expression body definition, as the following example shows. -:::code language="csharp" source="snippets/destructors/expr-bodied-destructor.cs" ID="Snippet1"::: +:::code language="csharp" source="snippets/finalizers/expr-bodied-finalizer.cs" ID="Snippet1"::: The finalizer implicitly calls on the base class of the object. Therefore, a call to a finalizer is implicitly translated to the following code: @@ -77,7 +77,7 @@ The following example creates three classes that make a chain of inheritance. Th * .NET Framework: The output shows that the finalizers for the three classes are called automatically when the application terminates, in order from the most-derived to the least-derived. * .NET 5 (including .NET Core) or a later version: There's no output, because this implementation of .NET doesn't call finalizers when the application terminates. -:::code language="csharp" source="snippets/destructors/Program.cs" ID="Snippet1"::: +:::code language="csharp" source="snippets/finalizers/Program.cs" ID="Snippet1"::: ## C# language specification diff --git a/docs/csharp/programming-guide/classes-and-structs/snippets/destructors/Program.cs b/docs/csharp/programming-guide/classes-and-structs/snippets/finalizers/Program.cs similarity index 100% rename from docs/csharp/programming-guide/classes-and-structs/snippets/destructors/Program.cs rename to docs/csharp/programming-guide/classes-and-structs/snippets/finalizers/Program.cs diff --git a/docs/csharp/programming-guide/classes-and-structs/snippets/destructors/expr-bodied-destructor.cs b/docs/csharp/programming-guide/classes-and-structs/snippets/finalizers/expr-bodied-finalizer.cs similarity index 80% rename from docs/csharp/programming-guide/classes-and-structs/snippets/destructors/expr-bodied-destructor.cs rename to docs/csharp/programming-guide/classes-and-structs/snippets/finalizers/expr-bodied-finalizer.cs index a4818795ad674..f7b06c384971b 100644 --- a/docs/csharp/programming-guide/classes-and-structs/snippets/destructors/expr-bodied-destructor.cs +++ b/docs/csharp/programming-guide/classes-and-structs/snippets/finalizers/expr-bodied-finalizer.cs @@ -5,7 +5,7 @@ public class Destroyer { public override string ToString() => GetType().Name; - ~Destroyer() => Console.WriteLine($"The {ToString()} destructor is executing."); + ~Destroyer() => Console.WriteLine($"The {ToString()} finalizer is executing."); } // diff --git a/docs/csharp/programming-guide/classes-and-structs/snippets/destructors/destructors.csproj b/docs/csharp/programming-guide/classes-and-structs/snippets/finalizers/finalizers.csproj similarity index 100% rename from docs/csharp/programming-guide/classes-and-structs/snippets/destructors/destructors.csproj rename to docs/csharp/programming-guide/classes-and-structs/snippets/finalizers/finalizers.csproj diff --git a/docs/csharp/programming-guide/statements-expressions-operators/expression-bodied-members.md b/docs/csharp/programming-guide/statements-expressions-operators/expression-bodied-members.md index e2e88f2ea0326..fd294d2850ba4 100644 --- a/docs/csharp/programming-guide/statements-expressions-operators/expression-bodied-members.md +++ b/docs/csharp/programming-guide/statements-expressions-operators/expression-bodied-members.md @@ -75,9 +75,9 @@ An expression body definition for a finalizer typically contains cleanup stateme The following example defines a finalizer that uses an expression body definition to indicate that the finalizer has been called. -[!code-csharp[expression-bodied-finalizer](../classes-and-structs/snippets/destructors/expr-bodied-destructor.cs#1)] +[!code-csharp[expression-bodied-finalizer](../classes-and-structs/snippets/finalizers/expr-bodied-finalizer.cs#1)] -For more information, see [Finalizers (C# Programming Guide)](../classes-and-structs/destructors.md). +For more information, see [Finalizers (C# Programming Guide)](../classes-and-structs/finalizers.md). ## Indexers diff --git a/docs/csharp/toc.yml b/docs/csharp/toc.yml index 1b0fb7d3f8019..8fcb91287d37c 100644 --- a/docs/csharp/toc.yml +++ b/docs/csharp/toc.yml @@ -709,7 +709,7 @@ items: - name: "How to write a copy constructor" href: programming-guide/classes-and-structs/how-to-write-a-copy-constructor.md - name: Finalizers - href: programming-guide/classes-and-structs/destructors.md + href: programming-guide/classes-and-structs/finalizers.md - name: Object and Collection Initializers href: programming-guide/classes-and-structs/object-and-collection-initializers.md - name: "How to initialize objects by using an object initializer" diff --git a/docs/csharp/tour-of-csharp/program-building-blocks.md b/docs/csharp/tour-of-csharp/program-building-blocks.md index 5f4841fc3eb94..c3730c6da9334 100644 --- a/docs/csharp/tour-of-csharp/program-building-blocks.md +++ b/docs/csharp/tour-of-csharp/program-building-blocks.md @@ -233,7 +233,7 @@ The first `Console.WriteLine` outputs `True` because the two lists contain the s ### Finalizers -A *finalizer* is a member that implements the actions required to finalize an instance of a class. Typically, a finalizer is needed to release unmanaged resources. Finalizers can't have parameters, they can't have accessibility modifiers, and they can't be invoked explicitly. The finalizer for an instance is invoked automatically during garbage collection. For more information, see the article on [finalizers](../programming-guide/classes-and-structs/destructors.md). +A *finalizer* is a member that implements the actions required to finalize an instance of a class. Typically, a finalizer is needed to release unmanaged resources. Finalizers can't have parameters, they can't have accessibility modifiers, and they can't be invoked explicitly. The finalizer for an instance is invoked automatically during garbage collection. For more information, see the article on [finalizers](../programming-guide/classes-and-structs/finalizers.md). The garbage collector is allowed wide latitude in deciding when to collect objects and run finalizers. Specifically, the timing of finalizer invocations isn't deterministic, and finalizers may be executed on any thread. For these and other reasons, classes should implement finalizers only when no other solutions are feasible. diff --git a/docs/framework/performance/performance-tips.md b/docs/framework/performance/performance-tips.md index b0e264ccf6cd2..0d5e86d694331 100644 --- a/docs/framework/performance/performance-tips.md +++ b/docs/framework/performance/performance-tips.md @@ -1,6 +1,6 @@ --- title: ".NET Performance Tips" -description: Explore performance tips to improve the execution speed of a program in .NET. See tips for boxing and unboxing, strings, and destructors. +description: Explore performance tips to improve the execution speed of a program in .NET. See tips for boxing and unboxing, strings, and finalizers. ms.date: "03/30/2017" helpviewer_keywords: - "C# language, performance" @@ -23,9 +23,9 @@ The term *performance* generally refers to the execution speed of a program. You When you concatenate a large number of string variables, for example in a tight loop, use instead of the C# [+ operator](../../csharp/language-reference/operators/addition-operator.md) or the Visual Basic [Concatenation Operators](../../visual-basic/language-reference/operators/concatenation-operators.md). For more information, see [How to concatenate multiple strings](../../csharp/how-to/concatenate-multiple-strings.md) and [Concatenation Operators in Visual Basic](../../visual-basic/programming-guide/language-features/operators-and-expressions/concatenation-operators.md). -## Destructors +## Finalizers - Empty destructors should not be used. When a class contains a destructor, an entry is created in the Finalize queue. When the destructor is called, the garbage collector is invoked to process the queue. If the destructor is empty, this simply results in a loss of performance. For more information, see [Destructors](../../csharp/programming-guide/classes-and-structs/destructors.md) and [Object Lifetime: How Objects Are Created and Destroyed](../../visual-basic/programming-guide/language-features/objects-and-classes/object-lifetime-how-objects-are-created-and-destroyed.md). + Empty finalizers should not be used. When a class contains a finalizer, an entry is created in the Finalize queue. When the finalizer is called, the garbage collector is invoked to process the queue. If the finalizer is empty, this simply results in a loss of performance. For more information, see [Finalizers](../../csharp/programming-guide/classes-and-structs/finalizers.md) and [Object Lifetime: How Objects Are Created and Destroyed](../../visual-basic/programming-guide/language-features/objects-and-classes/object-lifetime-how-objects-are-created-and-destroyed.md). ## Other Resources diff --git a/docs/standard/garbage-collection/implementing-dispose.md b/docs/standard/garbage-collection/implementing-dispose.md index e88974168b86e..853e479aef1c9 100644 --- a/docs/standard/garbage-collection/implementing-dispose.md +++ b/docs/standard/garbage-collection/implementing-dispose.md @@ -108,7 +108,7 @@ Here's the general pattern for implementing the dispose pattern for a base class :::code language="vb" source="../../../samples/snippets/visualbasic/VS_Snippets_CLR_System/system.idisposable/vb/base2.vb"::: > [!TIP] -> In C#, you create a finalizer by providing a [destructor](../../csharp/programming-guide/classes-and-structs/destructors.md), not by overriding . In Visual Basic, you create a finalizer with `Protected Overrides Sub Finalize()`. +> In C#, you implement a finalization by providing a [finalizer](../../csharp/programming-guide/classes-and-structs/finalizers.md), not by overriding . In Visual Basic, you create a finalizer with `Protected Overrides Sub Finalize()`. ## Implement the dispose pattern for a derived class diff --git a/docs/standard/garbage-collection/unmanaged.md b/docs/standard/garbage-collection/unmanaged.md index 9c2d5afc586d3..61be52a2cd10e 100644 --- a/docs/standard/garbage-collection/unmanaged.md +++ b/docs/standard/garbage-collection/unmanaged.md @@ -28,7 +28,7 @@ If your types use unmanaged resources, you should do the following: —**or**— - - Define a [finalizer](../../csharp/programming-guide/classes-and-structs/destructors.md). Finalization enables the non-deterministic release of unmanaged resources when the consumer of a type fails to call to dispose of them deterministically. + - Define a [finalizer](../../csharp/programming-guide/classes-and-structs/finalizers.md). Finalization enables the non-deterministic release of unmanaged resources when the consumer of a type fails to call to dispose of them deterministically. > [!WARNING] > However, because object finalization can be a complex and an error-prone operation, we recommend that you use a safe handle instead of providing your own finalizer. From 0d17eb8e140ad810ce34727f28a45aad3f52da91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD?= Date: Wed, 15 Sep 2021 22:25:31 +0200 Subject: [PATCH 2/8] URL redirect for destructors --- .openpublishing.redirection.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index 310dcf75881cd..c3e145b928118 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -167,7 +167,7 @@ }, { "source_path": "docs/azure/packages.md", - "redirect_url": "/dotnet/azure/sdk/packages" + "redirect_url": "/dotnet/azure/sdk/packages" }, { "source_path": "docs/azure/dependency-injection.md", @@ -1899,11 +1899,15 @@ { "source_path": "docs/csharp/programming-guide/classes-and-structs/anonymous-types.md", "redirect_url": "/dotnet/csharp/fundamentals/types/anonymous-types" - }, + }, { "source_path": "docs/csharp/programming-guide/classes-and-structs/classes.md", "redirect_url": "/dotnet/csharp/fundamentals/types/classes" }, + { + "source_path": "docs/csharp/programming-guide/classes-and-structs/finalizers.md", + "redirect_url": "/dotnet/csharp/programming-guide/classes-and-structs/destructors" + }, { "source_path": "docs/csharp/programming-guide/classes-and-structs/how-to-access-a-collection-class-with-foreach.md", "redirect_url": "/dotnet/csharp/language-reference/keywords/foreach-in" From f0b290b8561a2f2ac229d1730fb8634b8a06b432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD?= Date: Wed, 15 Sep 2021 22:49:33 +0200 Subject: [PATCH 3/8] Some relative URLs fix --- .../programming-guide/classes-and-structs/constructors.md | 2 +- .../classes-and-structs/how-to-write-a-copy-constructor.md | 2 +- .../classes-and-structs/instance-constructors.md | 2 +- docs/csharp/programming-guide/classes-and-structs/members.md | 2 +- .../classes-and-structs/private-constructors.md | 2 +- .../classes-and-structs/static-constructors.md | 2 +- .../programming-guide/classes-and-structs/using-constructors.md | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/csharp/programming-guide/classes-and-structs/constructors.md b/docs/csharp/programming-guide/classes-and-structs/constructors.md index 3b2b6fd1c699e..7cb94ccd05a10 100644 --- a/docs/csharp/programming-guide/classes-and-structs/constructors.md +++ b/docs/csharp/programming-guide/classes-and-structs/constructors.md @@ -56,6 +56,6 @@ For more information and examples, see [Static Constructors](./static-constructo - [C# Programming Guide](../index.md) - [Classes, structs, and records](/dotnet/csharp/fundamentals/object-oriented) -- [Finalizers](./destructors.md) +- [Finalizers](./finalizers.md) - [static](../../language-reference/keywords/static.md) - [Why Do Initializers Run In The Opposite Order As Constructors? Part One](/archive/blogs/ericlippert/why-do-initializers-run-in-the-opposite-order-as-constructors-part-one) diff --git a/docs/csharp/programming-guide/classes-and-structs/how-to-write-a-copy-constructor.md b/docs/csharp/programming-guide/classes-and-structs/how-to-write-a-copy-constructor.md index 0ac06341ea1e7..826d80cf2dad9 100644 --- a/docs/csharp/programming-guide/classes-and-structs/how-to-write-a-copy-constructor.md +++ b/docs/csharp/programming-guide/classes-and-structs/how-to-write-a-copy-constructor.md @@ -26,4 +26,4 @@ C# [records](../../fundamentals/types/records.md) provide a copy constructor for - [C# Programming Guide](../index.md) - [Classes, structs, and records](/dotnet/csharp/fundamentals/object-oriented) - [Constructors](./constructors.md) -- [Finalizers](./destructors.md) +- [Finalizers](./finalizers.md) diff --git a/docs/csharp/programming-guide/classes-and-structs/instance-constructors.md b/docs/csharp/programming-guide/classes-and-structs/instance-constructors.md index d8d55ee82110e..bbbd02f883e5f 100644 --- a/docs/csharp/programming-guide/classes-and-structs/instance-constructors.md +++ b/docs/csharp/programming-guide/classes-and-structs/instance-constructors.md @@ -69,5 +69,5 @@ class Circle : Shape - [C# Programming Guide](../index.md) - [Classes, structs, and records](/dotnet/csharp/fundamentals/object-oriented) - [Constructors](./constructors.md) -- [Finalizers](./destructors.md) +- [Finalizers](./finalizers.md) - [static](../../language-reference/keywords/static.md) diff --git a/docs/csharp/programming-guide/classes-and-structs/members.md b/docs/csharp/programming-guide/classes-and-structs/members.md index 1da14a7fd46b9..13f101e70b86c 100644 --- a/docs/csharp/programming-guide/classes-and-structs/members.md +++ b/docs/csharp/programming-guide/classes-and-structs/members.md @@ -23,7 +23,7 @@ Classes and structs have members that represent their data and behavior. A class |[Operators](../../language-reference/operators/index.md)|Overloaded operators are considered type members. When you overload an operator, you define it as a public static method in a type. For more information, see [Operator overloading](../../language-reference/operators/operator-overloading.md).| |[Indexers](../indexers/index.md)|Indexers enable an object to be indexed in a manner similar to arrays.| |[Constructors](./constructors.md)|Constructors are methods that are called when the object is first created. They are often used to initialize the data of an object.| -|[Finalizers](./destructors.md)|Finalizers are used very rarely in C#. They are methods that are called by the runtime execution engine when the object is about to be removed from memory. They are generally used to make sure that any resources which must be released are handled appropriately.| +|[Finalizers](./finalizers.md)|Finalizers are used very rarely in C#. They are methods that are called by the runtime execution engine when the object is about to be removed from memory. They are generally used to make sure that any resources which must be released are handled appropriately.| |[Nested Types](./nested-types.md)|Nested types are types declared within another type. Nested types are often used to describe objects that are used only by the types that contain them.| ## See also diff --git a/docs/csharp/programming-guide/classes-and-structs/private-constructors.md b/docs/csharp/programming-guide/classes-and-structs/private-constructors.md index 28351e8aa84b9..7d77ab709214f 100644 --- a/docs/csharp/programming-guide/classes-and-structs/private-constructors.md +++ b/docs/csharp/programming-guide/classes-and-structs/private-constructors.md @@ -36,6 +36,6 @@ For more information, see [Private constructors](~/_csharplang/spec/classes.md#p - [C# Programming Guide](../index.md) - [Classes, structs, and records](/dotnet/csharp/fundamentals/object-oriented) - [Constructors](./constructors.md) -- [Finalizers](./destructors.md) +- [Finalizers](./finalizers.md) - [private](../../language-reference/keywords/private.md) - [public](../../language-reference/keywords/public.md) diff --git a/docs/csharp/programming-guide/classes-and-structs/static-constructors.md b/docs/csharp/programming-guide/classes-and-structs/static-constructors.md index e82153d038f74..9c56087788c7c 100644 --- a/docs/csharp/programming-guide/classes-and-structs/static-constructors.md +++ b/docs/csharp/programming-guide/classes-and-structs/static-constructors.md @@ -64,6 +64,6 @@ For more information, see the [Static constructors](~/_csharplang/spec/classes.m - [Classes, structs, and records](/dotnet/csharp/fundamentals/object-oriented) - [Constructors](./constructors.md) - [Static Classes and Static Class Members](./static-classes-and-static-class-members.md) -- [Finalizers](./destructors.md) +- [Finalizers](./finalizers.md) - [Constructor Design Guidelines](../../../standard/design-guidelines/constructor.md#type-constructor-guidelines) - [Security Warning - CA2121: Static constructors should be private](/visualstudio/code-quality/ca2121-static-constructors-should-be-private) diff --git a/docs/csharp/programming-guide/classes-and-structs/using-constructors.md b/docs/csharp/programming-guide/classes-and-structs/using-constructors.md index e89a09294edcd..e40c120a2bd90 100644 --- a/docs/csharp/programming-guide/classes-and-structs/using-constructors.md +++ b/docs/csharp/programming-guide/classes-and-structs/using-constructors.md @@ -92,4 +92,4 @@ For more information, see [Instance constructors](~/_csharplang/spec/classes.md# - [C# Programming Guide](../index.md) - [Classes, structs, and records](/dotnet/csharp/fundamentals/object-oriented) - [Constructors](./constructors.md) -- [Finalizers](./destructors.md) +- [Finalizers](./finalizers.md) From 553e5e001a457f2c71451344aa64d0b11437ee49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD?= Date: Wed, 15 Sep 2021 23:08:19 +0200 Subject: [PATCH 4/8] Missing redirect --- .openpublishing.redirection.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index c3e145b928118..cbba6824df05a 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -167,7 +167,7 @@ }, { "source_path": "docs/azure/packages.md", - "redirect_url": "/dotnet/azure/sdk/packages" + "redirect_url": "/dotnet/azure/sdk/packages" }, { "source_path": "docs/azure/dependency-injection.md", @@ -1899,15 +1899,19 @@ { "source_path": "docs/csharp/programming-guide/classes-and-structs/anonymous-types.md", "redirect_url": "/dotnet/csharp/fundamentals/types/anonymous-types" - }, + }, { "source_path": "docs/csharp/programming-guide/classes-and-structs/classes.md", "redirect_url": "/dotnet/csharp/fundamentals/types/classes" }, - { + { "source_path": "docs/csharp/programming-guide/classes-and-structs/finalizers.md", "redirect_url": "/dotnet/csharp/programming-guide/classes-and-structs/destructors" }, + { + "source_path": "docs/csharp/programming-guide/classes-and-structs/finalizers.md", + "redirect_url": "/docs/csharp/programming-guide/classes-and-structs/destructors.md" + }, { "source_path": "docs/csharp/programming-guide/classes-and-structs/how-to-access-a-collection-class-with-foreach.md", "redirect_url": "/dotnet/csharp/language-reference/keywords/foreach-in" From b0cb96f08732216996bdb70784e90065da909c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD?= Date: Thu, 16 Sep 2021 19:03:19 +0200 Subject: [PATCH 5/8] Revert --- .openpublishing.redirection.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index cbba6824df05a..cfc5ea53c650f 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -1908,10 +1908,6 @@ "source_path": "docs/csharp/programming-guide/classes-and-structs/finalizers.md", "redirect_url": "/dotnet/csharp/programming-guide/classes-and-structs/destructors" }, - { - "source_path": "docs/csharp/programming-guide/classes-and-structs/finalizers.md", - "redirect_url": "/docs/csharp/programming-guide/classes-and-structs/destructors.md" - }, { "source_path": "docs/csharp/programming-guide/classes-and-structs/how-to-access-a-collection-class-with-foreach.md", "redirect_url": "/dotnet/csharp/language-reference/keywords/foreach-in" From 544ba65144d1738647509991517aa4118f267bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD?= Date: Thu, 16 Sep 2021 20:50:05 +0200 Subject: [PATCH 6/8] Attempt to fix redirect --- .openpublishing.redirection.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index cfc5ea53c650f..bc4cf9103b4aa 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -1904,9 +1904,9 @@ "source_path": "docs/csharp/programming-guide/classes-and-structs/classes.md", "redirect_url": "/dotnet/csharp/fundamentals/types/classes" }, - { - "source_path": "docs/csharp/programming-guide/classes-and-structs/finalizers.md", - "redirect_url": "/dotnet/csharp/programming-guide/classes-and-structs/destructors" + { + "source_path": "/dotnet/csharp/programming-guide/classes-and-structs/destructors", + "redirect_url": "docs/csharp/programming-guide/classes-and-structs/finalizers.md" }, { "source_path": "docs/csharp/programming-guide/classes-and-structs/how-to-access-a-collection-class-with-foreach.md", From b12b5a1ded7d9d03d2a585fb2b68d3d129790af6 Mon Sep 17 00:00:00 2001 From: Uzivatel919 Date: Thu, 16 Sep 2021 21:42:08 +0200 Subject: [PATCH 7/8] Update .openpublishing.redirection.json Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- .openpublishing.redirection.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index bc4cf9103b4aa..89f779787bbfa 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -1905,7 +1905,7 @@ "redirect_url": "/dotnet/csharp/fundamentals/types/classes" }, { - "source_path": "/dotnet/csharp/programming-guide/classes-and-structs/destructors", + "source_path": "docs/csharp/programming-guide/classes-and-structs/destructors.md", "redirect_url": "docs/csharp/programming-guide/classes-and-structs/finalizers.md" }, { From 94913ff0ca7251e2a912effd80f22c353577d2fc Mon Sep 17 00:00:00 2001 From: Uzivatel919 Date: Thu, 16 Sep 2021 21:42:13 +0200 Subject: [PATCH 8/8] Update .openpublishing.redirection.json Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- .openpublishing.redirection.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index 89f779787bbfa..197d41f0ff1b3 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -1906,7 +1906,7 @@ }, { "source_path": "docs/csharp/programming-guide/classes-and-structs/destructors.md", - "redirect_url": "docs/csharp/programming-guide/classes-and-structs/finalizers.md" + "redirect_url": "/dotnet/csharp/programming-guide/classes-and-structs/finalizers" }, { "source_path": "docs/csharp/programming-guide/classes-and-structs/how-to-access-a-collection-class-with-foreach.md",