Skip to content
Closed
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
240 changes: 240 additions & 0 deletions .openpublishing.redirection.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,245 @@
{
"redirections": [
{
"source_path": "docs/standard/design-guidelines/abstract-class.md",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These need to go to .openpublishing.redirection.standard.json

"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/abstract-class",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/abstractions-abstract-types-and-interfaces.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/abstractions-abstract-types-and-interfaces",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/arrays.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/arrays",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/attributes.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/attributes",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/base-classes-for-implementing-abstractions.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/base-classes-for-implementing-abstractions",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/capitalization-conventions.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/capitalization-conventions",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/choosing-between-class-and-struct.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/choosing-between-class-and-struct",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/common-design-patterns.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/common-design-patterns",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/constructor.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/constructor",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/dependency-properties.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/dependency-properties",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/designing-for-extensibility.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/designing-for-extensibility",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/enum.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/enum",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/equality-operators.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/equality-operators",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/event.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/event",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/events-and-callbacks.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/events-and-callbacks",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/exception-throwing.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/exception-throwing",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/exceptions-and-performance.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/exceptions-and-performance",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/exceptions.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/exceptions",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/extension-methods.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/extension-methods",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/field.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/field",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/general-naming-conventions.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/general-naming-conventions",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/guidelines-for-collections.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/guidelines-for-collections",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/index.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/index",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/interface.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/interface",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/member-overloading.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/member-overloading",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/member.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/member",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/names-of-assemblies-and-dlls.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/names-of-assemblies-and-dlls",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/names-of-classes-structs-and-interfaces.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/names-of-namespaces.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/names-of-namespaces",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/names-of-type-members.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/names-of-type-members",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/naming-guidelines.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/naming-guidelines",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/naming-parameters.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/naming-parameters",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/naming-resources.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/naming-resources",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/nested-types.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/nested-types",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/operator-overloads.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/operator-overloads",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/parameter-design.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/parameter-design",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/property.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/property",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/protected-members.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/protected-members",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/sealing.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/sealing",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/serialization.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/serialization",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/static-class.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/static-class",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/struct.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/struct",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/system-xml-usage.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/system-xml-usage",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/type.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/type",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/unsealed-classes.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/unsealed-classes",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/usage-guidelines.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/usage-guidelines",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/using-standard-exception-types.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/using-standard-exception-types",
"redirect_document_id": false
},
{
"source_path": "docs/standard/design-guidelines/virtual-members.md",
"redirect_url": "/previous-versions/dotnet/standard/design-guidelines/virtual-members",
"redirect_document_id": false
},
{
"source_path_from_root": "/docs/about/index.md",
"redirect_url": "/dotnet/standard/index"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: More migration scenarios
description: This section describes additional migration scenarios and techniques for upgrading .NET Framework apps to .NET Core / .NET 6.
author: ardalis
ms.date: 02/11/2021
ms.date: 12/10/2021
---

# More migration scenarios
Expand Down Expand Up @@ -237,7 +237,7 @@ ASP.NET Core uses route constraints to help ensure requests are routed properly
[Route("/customer/{id:int}")]
```

The `:int` after the `id` route parameter constrains the value to match the the `int` type. One benefit of using route constraints is that they allow for two otherwise-identical routes to exist where the parameters differ only by their type. This allows for the equivalent of [method overloading](../../standard/design-guidelines/member-overloading.md) of routes based solely on parameter type.
The `:int` after the `id` route parameter constrains the value to match the the `int` type. One benefit of using route constraints is that they allow for two otherwise-identical routes to exist where the parameters differ only by their type. This allows for the equivalent of method overloading of routes based solely on parameter type.

The set of route constraints, their syntax, and usage is very similar between all three approaches. Custom route constraints are fairly rare in customer applications. If your app uses a custom route constraint and needs to port to ASP.NET Core, the docs include examples showing [how to create custom route constraints in ASP.NET Core](/aspnet/core/fundamentals/routing#custom-route-constraints). Essentially all that's required is to implement `IRouteConstraint` and its `Match` method, and then add the custom constraint when configuring routing for the app:

Expand Down
4 changes: 2 additions & 2 deletions docs/core/extensions/high-performance-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The sample app demonstrates <xref:Microsoft.Extensions.Logging.LoggerMessage> fe

Use [Define(LogLevel, EventId, String)](xref:Microsoft.Extensions.Logging.LoggerMessage.Define%2A) to create an <xref:System.Action> delegate for logging a message. <xref:Microsoft.Extensions.Logging.LoggerMessage.Define%2A> overloads permit passing up to six type parameters to a named format string (template).

The string provided to the <xref:Microsoft.Extensions.Logging.LoggerMessage.Define%2A> method is a template and not an interpolated string. Placeholders are filled in the order that the types are specified. Placeholder names in the template should be descriptive and consistent across templates. They serve as property names within structured log data. We recommend [Pascal casing](../../standard/design-guidelines/capitalization-conventions.md) for placeholder names. For example, `{Item}`, `{DateTime}`.
The string provided to the <xref:Microsoft.Extensions.Logging.LoggerMessage.Define%2A> method is a template and not an interpolated string. Placeholders are filled in the order that the types are specified. Placeholder names in the template should be descriptive and consistent across templates. They serve as property names within structured log data. We recommend pascal casing for placeholder names. For example, `{Item}`, `{DateTime}`.

Each log message is an <xref:System.Action> held in a static field created by [LoggerMessage.Define](xref:Microsoft.Extensions.Logging.LoggerMessage.Define%2A). For example, the sample app creates a field to describe a log message for the processing of work items:

Expand Down Expand Up @@ -86,7 +86,7 @@ info: WorkerServiceOptions.Example.Worker[1]

The [DefineScope(string)](xref:Microsoft.Extensions.Logging.LoggerMessage.DefineScope%2A) method creates a <xref:System.Func%601> delegate for defining a [log scope](logging.md#log-scopes). <xref:Microsoft.Extensions.Logging.LoggerMessage.DefineScope%2A> overloads permit passing up to three type parameters to a named format string (template).

As is the case with the <xref:Microsoft.Extensions.Logging.LoggerMessage.Define%2A> method, the string provided to the <xref:Microsoft.Extensions.Logging.LoggerMessage.DefineScope%2A> method is a template and not an interpolated string. Placeholders are filled in the order that the types are specified. Placeholder names in the template should be descriptive and consistent across templates. They serve as property names within structured log data. We recommend [Pascal casing](../../standard/design-guidelines/capitalization-conventions.md) for placeholder names. For example, `{Item}`, `{DateTime}`.
As is the case with the <xref:Microsoft.Extensions.Logging.LoggerMessage.Define%2A> method, the string provided to the <xref:Microsoft.Extensions.Logging.LoggerMessage.DefineScope%2A> method is a template and not an interpolated string. Placeholders are filled in the order that the types are specified. Placeholder names in the template should be descriptive and consistent across templates. They serve as property names within structured log data. We recommend pascal casing for placeholder names. For example, `{Item}`, `{DateTime}`.

Define a [log scope](logging.md#log-scopes) to apply to a series of log messages using the <xref:Microsoft.Extensions.Logging.LoggerMessage.DefineScope%2A> method. Enable `IncludeScopes` in the console logger section of *appsettings.json*:

Expand Down
12 changes: 7 additions & 5 deletions docs/csharp/fundamentals/coding-style/identifier-names.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
---
title: "Identifier names"
description: "Learn the rules for valid identifier names in the C# programming language."
ms.date: 08/21/2018
ms.date: 12/10/2021
---

# Identifier names

An **identifier** is the name you assign to a type (class, interface, struct, delegate, or enum), member, variable, or namespace. Valid identifiers must follow these rules:

- Identifiers must start with a letter, or `_`.
- Identifiers may contain Unicode letter characters, decimal digit characters, Unicode connecting characters, Unicode combining characters, or Unicode formatting characters. For more information on Unicode categories, see the [Unicode Category Database](https://www.unicode.org/reports/tr44/).
You can declare identifiers that match C# keywords by using the `@` prefix on the identifier. The `@` is not part of the identifier name. For example, `@if` declares an identifier named `if`. These [verbatim identifiers](../../language-reference/tokens/verbatim.md) are primarily for interoperability with identifiers declared in other languages.
You can declare identifiers that match C# keywords by using the `@` prefix on the identifier. The `@` is not part of the identifier name. For example, `@if` declares an identifier named `if`. These [verbatim identifiers](../../language-reference/tokens/verbatim.md) are primarily for interoperability with identifiers declared in other languages.

For a complete definition of valid identifiers, see the [Identifiers topic in the C# Language Specification](~/_csharplang/spec/lexical-structure.md#identifiers).

## Naming conventions

In addition to the rules, there are many identifier [naming conventions](../../../standard/design-guidelines/naming-guidelines.md) used throughout the .NET APIs. By convention, C# programs use `PascalCase` for type names, namespaces, and all public members. In addition, the following conventions are common:
In addition to the rules, there are many identifier naming conventions used throughout the .NET APIs. By convention, C# programs use `PascalCase` for type names, namespaces, and all public members. In addition, the following conventions are common:

- Interface names start with a capital `I`.
- Attribute types end with the word `Attribute`.
Expand All @@ -24,8 +25,8 @@ In addition to the rules, there are many identifier [naming conventions](../../.

## C# Language Specification

[!INCLUDE[CSharplangspec](~/includes/csharplangspec-md.md)]
[!INCLUDE[CSharplangspec](~/includes/csharplangspec-md.md)]

## See also

- [C# Programming Guide](../../programming-guide/index.md)
Expand All @@ -35,3 +36,4 @@ In addition to the rules, there are many identifier [naming conventions](../../.
- [Namespaces](../types/namespaces.md)
- [Interfaces](../types/interfaces.md)
- [Delegates](../../programming-guide/delegates/index.md)
- [Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries](https://aka.ms/dotnet/framework-design-guidelines)
3 changes: 1 addition & 2 deletions docs/csharp/language-reference/builtin-types/enum.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ For more information, see the following sections of the [C# language specificati

- [C# reference](../index.md)
- [Enumeration format strings](../../../standard/base-types/enumeration-format-strings.md)
- [Design guidelines - Enum design](../../../standard/design-guidelines/enum.md)
- [Design guidelines - Enum naming conventions](../../../standard/design-guidelines/names-of-classes-structs-and-interfaces.md#naming-enumerations)
- [`switch` expression](../operators/switch-expression.md)
- [`switch` statement](../statements/selection-statements.md#the-switch-statement)
- [Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries](https://aka.ms/dotnet/framework-design-guidelines)
Loading