diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index bd37e929009f9..a356668c8adb7 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -2980,7 +2980,27 @@ }, { "source_path": "docs/csharp/tutorials/default-interface-members-versions.md", - "redirect_url": "/dotnet/csharp/tutorials/default-interface-methods-versions" + "redirect_url": "/dotnet/csharp/whats-new/tutorials/default-interface-methods-versions" + }, + { + "source_path": "docs/csharp/tutorials/generate-consume-asynchronous-stream.md", + "redirect_url": "/dotnet/csharp/whats-new/tutorials/generate-consume-asynchronous-stream" + }, + { + "source_path": "docs/csharp/tutorials/mixins-with-default-interface-methods.md", + "redirect_url": "/dotnet/csharp/whats-new/tutorials/mixins-with-default-interface-methods" + }, + { + "source_path": "docs/csharp/tutorials/nullable-reference-types.md", + "redirect_url": "/dotnet/csharp/whats-new/tutorials/nullable-reference-types" + }, + { + "source_path": "docs/csharp/tutorials/ranges-indexes.md", + "redirect_url": "/dotnet/csharp/whats-new/tutorials/ranges-indexes" + }, + { + "source_path": "docs/csharp/tutorials/upgrade-to-nullable-references.md", + "redirect_url": "/dotnet/csharp/whats-new/tutorials/upgrade-to-nullable-references" }, { "source_path": "docs/csharp/tutorials/exploration/csharp-6.yml", @@ -2990,6 +3010,18 @@ "source_path": "docs/csharp/tutorials/exploration/csharp-7.yml", "redirect_url": "/dotnet/csharp/whats-new/csharp-7" }, + { + "source_path": "docs/csharp/tutorials/exploration/patterns-objects.md", + "redirect_url": "/dotnet/csharp/whats-new/tutorials/patterns-objects" + }, + { + "source_path": "docs/csharp/tutorials/exploration/records.md", + "redirect_url": "/dotnet/csharp/whats-new/tutorials/records" + }, + { + "source_path": "docs/csharp/tutorials/exploration/top-level-statements.md", + "redirect_url": "/dotnet/csharp/whats-new/tutorials/top-level-statements" + }, { "source_path": "docs/csharp/tutorials/intro-to-csharp/index.md", "redirect_url": "/dotnet/csharp/tour-of-csharp/tutorials/" @@ -3026,7 +3058,10 @@ "source_path": "docs/csharp/tutorials/intro-to-csharp/arrays-and-collections.md", "redirect_url": "/dotnet/csharp/tour-of-csharp/tutorials/arrays-and-collections" }, - + { + "source_path": "docs/csharp/tutorials/index.md", + "redirect_url": "/dotnet/csharp/tutorials/intro-to-csharp/introduction-to-classes" + }, { "source_path": "docs/csharp/tutorials/intro-to-csharp/interpolated-strings-local.md", "redirect_url": "/dotnet/csharp/tutorials/exploration/interpolated-strings-local" diff --git a/docs/core/whats-new/dotnet-core-3-0.md b/docs/core/whats-new/dotnet-core-3-0.md index 48216d65260ef..8539139b7b6a7 100644 --- a/docs/core/whats-new/dotnet-core-3-0.md +++ b/docs/core/whats-new/dotnet-core-3-0.md @@ -26,8 +26,8 @@ C# 8.0 is also part of this release, which includes the [nullable reference type Tutorials related to C# 8.0 language features: -- [Tutorial: Express your design intent more clearly with nullable and non-nullable reference types](../../csharp/tutorials/nullable-reference-types.md) -- [Tutorial: Generate and consume async streams using C# 8.0 and .NET Core 3.0](../../csharp/tutorials/generate-consume-asynchronous-stream.md) +- [Tutorial: Express your design intent more clearly with nullable and non-nullable reference types](../../csharp/whats-new/tutorials/nullable-reference-types.md) +- [Tutorial: Generate and consume async streams using C# 8.0 and .NET Core 3.0](../../csharp/whats-new/tutorials/generate-consume-asynchronous-stream.md) - [Tutorial: Use pattern matching to build type-driven and data-driven algorithms](../../csharp/tutorials/pattern-matching.md) Language enhancements were added to support the following API features detailed below: @@ -450,7 +450,7 @@ There's also the type, which co var slice = a[i1..i2]; // { 3, 4, 5 } ``` -For more information, see the [ranges and indices tutorial](../../csharp/tutorials/ranges-indexes.md). +For more information, see the [ranges and indices tutorial](../../csharp/whats-new/tutorials/ranges-indexes.md). ### Async streams @@ -470,7 +470,7 @@ async IAsyncEnumerable GetBigResultsAsync() In addition to being able to `await foreach`, you can also create async iterators, for example, an iterator that returns an `IAsyncEnumerable/IAsyncEnumerator` that you can both `await` and `yield` in. For objects that need to be disposed, you can use `IAsyncDisposable`, which various BCL types implement, such as `Stream` and `Timer`. -For more information, see the [async streams tutorial](../../csharp/tutorials/generate-consume-asynchronous-stream.md). +For more information, see the [async streams tutorial](../../csharp/whats-new/tutorials/generate-consume-asynchronous-stream.md). ### IEEE Floating-point diff --git a/docs/csharp/language-reference/operators/await.md b/docs/csharp/language-reference/operators/await.md index 3a77247779ba6..83bbe142f32d5 100644 --- a/docs/csharp/language-reference/operators/await.md +++ b/docs/csharp/language-reference/operators/await.md @@ -55,4 +55,4 @@ For more information, see the [Await expressions](~/_csharplang/spec/expressions - [Asynchronous programming](../../async.md) - [Async in depth](../../../standard/async-in-depth.md) - [Walkthrough: accessing the Web by using async and await](../../programming-guide/concepts/async/index.md) -- [Tutorial: Generate and consume async streams using C# 8.0 and .NET Core 3.0](../../tutorials/generate-consume-asynchronous-stream.md) +- [Tutorial: Generate and consume async streams using C# 8.0 and .NET Core 3.0](../../whats-new/tutorials/generate-consume-asynchronous-stream.md) diff --git a/docs/csharp/language-reference/operators/member-access-operators.md b/docs/csharp/language-reference/operators/member-access-operators.md index b84a5cc96c2fa..fe4282c991f75 100644 --- a/docs/csharp/language-reference/operators/member-access-operators.md +++ b/docs/csharp/language-reference/operators/member-access-operators.md @@ -176,7 +176,7 @@ Available in C# 8.0 and later, the `^` operator indicates the element position f As the preceding example shows, expression `^e` is of the type. In expression `^e`, the result of `e` must be implicitly convertible to `int`. -You can also use the `^` operator with the [range operator](#range-operator-) to create a range of indices. For more information, see [Indices and ranges](../../tutorials/ranges-indexes.md). +You can also use the `^` operator with the [range operator](#range-operator-) to create a range of indices. For more information, see [Indices and ranges](../../whats-new/tutorials/ranges-indexes.md). ## Range operator .. @@ -194,7 +194,7 @@ You can omit any of the operands of the `..` operator to obtain an open-ended ra [!code-csharp[ranges with omitted operands](snippets/shared/MemberAccessOperators.cs#RangesOptional)] -For more information, see [Indices and ranges](../../tutorials/ranges-indexes.md). +For more information, see [Indices and ranges](../../whats-new/tutorials/ranges-indexes.md). ## Operator overloadability diff --git a/docs/csharp/nullable-references.md b/docs/csharp/nullable-references.md index 935b5762e6def..4794000e0f3fd 100644 --- a/docs/csharp/nullable-references.md +++ b/docs/csharp/nullable-references.md @@ -210,6 +210,6 @@ In the preceding example, the declaration of the array shows it holds non-nullab ## See also - [Draft nullable reference types specification](~/_csharplang/proposals/csharp-9.0/nullable-reference-types-specification.md) -- [Intro to nullable references tutorial](tutorials/nullable-reference-types.md) +- [Intro to nullable references tutorial](whats-new/tutorials/nullable-reference-types.md) - [Migrate an existing codebase to nullable references](tutorials/upgrade-to-nullable-references.md) - [**Nullable** (C# Compiler option)](language-reference/compiler-options/language.md#nullable) diff --git a/docs/csharp/programming-guide/interfaces/index.md b/docs/csharp/programming-guide/interfaces/index.md index 5ca746124698a..cef89cb4bc00b 100644 --- a/docs/csharp/programming-guide/interfaces/index.md +++ b/docs/csharp/programming-guide/interfaces/index.md @@ -45,7 +45,7 @@ A base class can also implement interface members by using virtual members. In t An interface has the following properties: -- An interface is typically like an abstract base class with only abstract members. Any class or struct that implements the interface must implement all its members. Optionally, an interface may define default implementations for some or all of its members. For more information, see [default interface methods](../../tutorials/default-interface-methods-versions.md). +- An interface is typically like an abstract base class with only abstract members. Any class or struct that implements the interface must implement all its members. Optionally, an interface may define default implementations for some or all of its members. For more information, see [default interface methods](../../whats-new/tutorials/default-interface-methods-versions.md). - An interface can't be instantiated directly. Its members are implemented by any class or struct that implements the interface. - A class or struct can implement multiple interfaces. A class can inherit a base class and also implement one or more interfaces. diff --git a/docs/csharp/toc.yml b/docs/csharp/toc.yml index abcfacc079528..b2ffd7edf06ec 100644 --- a/docs/csharp/toc.yml +++ b/docs/csharp/toc.yml @@ -35,41 +35,55 @@ items: href: tour-of-csharp/tutorials/branches-and-loops-local.md - name: List collections href: tour-of-csharp/tutorials/arrays-and-collections.md +- name: What's new in C# + items: + - name: C# 9.0 + displayName: what's new + href: whats-new/csharp-9.md + - name: C# 8.0 + href: whats-new/csharp-8.md + - name: C# 7.0-7.3 + href: whats-new/csharp-7.md + - name: Compiler breaking changes + href: whats-new/breaking-changes.md + - name: C# Version History + href: whats-new/csharp-version-history.md + - name: Relationships to .NET library + href: whats-new/relationships-between-language-and-library.md + - name: Version compatibility + href: whats-new/version-update-considerations.md + - name: Tutorials + items: + - name: Explore record types + href: whats-new/tutorials/records.md + - name: Explore top level statements + href: whats-new/tutorials/top-level-statements.md + - name: Explore patterns in objects + href: whats-new/tutorials/patterns-objects.md + - name: Safely update interfaces with default interface methods + href: whats-new/tutorials/default-interface-methods-versions.md + - name: Create mixin functionality with default interface methods + href: whats-new/tutorials/mixins-with-default-interface-methods.md + - name: Explore indexes and ranges + href: whats-new/tutorials/ranges-indexes.md + - name: Work with nullable reference types + href: whats-new/tutorials/nullable-reference-types.md + - name: Upgrade an app to nullable reference types + href: whats-new/tutorials/upgrade-to-nullable-references.md + - name: Generate and consume asynchronous streams + href: whats-new/tutorials/generate-consume-asynchronous-stream.md - name: Tutorials items: - - name: Overview - displayName: tutorials - href: tutorials/index.md - name: Introduction to classes href: tutorials/intro-to-csharp/introduction-to-classes.md - name: Object-Oriented programming href: tutorials/intro-to-csharp/object-oriented-programming.md - - name: Explore record types - href: tutorials/exploration/records.md - - name: Explore top level statements - href: tutorials/exploration/top-level-statements.md - - name: Explore patterns in objects - href: tutorials/exploration/patterns-objects.md - name: Explore string interpolation - interactive href: tutorials/exploration/interpolated-strings.yml - name: Explore string interpolation - in your environment href: tutorials/exploration/interpolated-strings-local.md - name: Advanced scenarios for string Interpolation href: tutorials/string-interpolation.md - - name: Safely update interfaces with default interface methods - href: tutorials/default-interface-methods-versions.md - - name: Create mixin functionality with default interface methods - href: tutorials/mixins-with-default-interface-methods.md - - name: Explore indexes and ranges - href: tutorials/ranges-indexes.md - - name: Work with nullable reference types - href: tutorials/nullable-reference-types.md - - name: Upgrade an app to nullable reference types - href: tutorials/upgrade-to-nullable-references.md - - name: Generate and consume asynchronous streams - href: tutorials/generate-consume-asynchronous-stream.md - - name: Build data-driven algorithms with pattern matching - href: tutorials/pattern-matching.md - name: Console Application href: tutorials/console-teleprompter.md - name: REST Client @@ -80,23 +94,8 @@ items: href: tutorials/working-with-linq.md - name: Use Attributes href: tutorials/attributes.md -- name: What's new in C# - items: - - name: C# 9.0 - displayName: what's new - href: whats-new/csharp-9.md - - name: C# 8.0 - href: whats-new/csharp-8.md - - name: C# 7.0-7.3 - href: whats-new/csharp-7.md - - name: Breaking changes in the compiler - href: whats-new/breaking-changes.md - - name: C# Version History - href: whats-new/csharp-version-history.md - - name: Relationships between language and framework - href: whats-new/relationships-between-language-and-library.md - - name: Version and update considerations - href: whats-new/version-update-considerations.md + - name: Build data-driven algorithms with pattern matching + href: tutorials/pattern-matching.md - name: C# concepts items: - name: C# type system diff --git a/docs/csharp/tutorials/index.md b/docs/csharp/tutorials/index.md deleted file mode 100644 index 49022bfd8a365..0000000000000 --- a/docs/csharp/tutorials/index.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: C# Tutorials -description: Explore these C# tutorials to learn how to build C# programs and learn C# language features. -ms.date: 10/25/2018 ---- -# C# Tutorials - -Welcome to the C# tutorials. These start with interactive lessons that you can run in your browser. Later tutorials and more advanced tutorials help you work with the .NET development tools to create C# programs on your machine. - -## Explore new features in C\# - -* [String Interpolation](string-interpolation.md): demonstrates how to use string interpolation to create formatted strings in C#. -* [Nullable reference types](nullable-reference-types.md): demonstrates how to use nullable reference types to express your intent for null references. -* [Update a project to make use of Nullable reference types](upgrade-to-nullable-references.md): demonstrates techniques to upgrade an existing project to make use of nullable reference types. -* [Extend data capabilities using pattern matching](pattern-matching.md): demonstrates how to use pattern matching to extend types beyond their core features. -* [Work with data sequences using indexes and ranges](ranges-indexes.md): Demonstrates new convenient syntax for accessing single elements or ranges of a sequential data container. - -## General Tutorials - -The following tutorials enable you to build C# programs using [.NET Core](../../core/introduction.md): - -* [Console Application](console-teleprompter.md): demonstrates Console I/O, the structure of a Console application, and the basics of the task-based asynchronous programming model. -* [REST Client](console-webapiclient.md): demonstrates web communications, JSON serialization, and object-oriented features in the C# language. -* [Inheritance in C# and .NET](inheritance.md): demonstrates inheritance in C#, including the use of inheritance to define base classes, abstract base classes, and derived classes. -* [Working with LINQ](working-with-linq.md): demonstrates many of the features of LINQ and the language elements that support it. -* [Using Attributes](attributes.md): demonstrates how to create and use attributes in C#. -* [String interpolation](exploration/interpolated-strings.yml) tutorial shows you how to insert values into a string. You'll learn how to create an interpolated string with embedded C# expressions and how to control the text appearance of the expression results in the result string. This tutorial is also available [to run locally on your machine](exploration/interpolated-strings-local.md). diff --git a/docs/csharp/whats-new/csharp-8.md b/docs/csharp/whats-new/csharp-8.md index 6f69cc9369bef..6faa366d25ddb 100644 --- a/docs/csharp/whats-new/csharp-8.md +++ b/docs/csharp/whats-new/csharp-8.md @@ -90,7 +90,7 @@ For more information, see the [`readonly` instance members](../language-referenc You can now add members to interfaces and provide an implementation for those members. This language feature enables API authors to add methods to an interface in later versions without breaking source or binary compatibility with existing implementations of that interface. Existing implementations *inherit* the default implementation. This feature also enables C# to interoperate with APIs that target Android or Swift, which support similar features. Default interface methods also enable scenarios similar to a "traits" language feature. -Default interface methods affect many scenarios and language elements. Our first tutorial covers [updating an interface with default implementations](../tutorials/default-interface-methods-versions.md). Other tutorials and reference updates are coming in time for general release. +Default interface methods affect many scenarios and language elements. Our first tutorial covers [updating an interface with default implementations](./tutorials/default-interface-methods-versions.md). ## More patterns in more places @@ -353,7 +353,7 @@ For nonnullable reference types, the compiler uses flow analysis to ensure that Nullable reference types aren't checked to ensure they aren't assigned or initialized to null. However, the compiler uses flow analysis to ensure that any variable of a nullable reference type is checked against null before it's accessed or assigned to a nonnullable reference type. -You can learn more about the feature in the overview of [nullable reference types](../nullable-references.md). Try it yourself in a new application in this [nullable reference types tutorial](../tutorials/nullable-reference-types.md). Learn about the steps to migrate an existing codebase to make use of nullable reference types in the [migrating an application to use nullable reference types tutorial](../tutorials/upgrade-to-nullable-references.md). +You can learn more about the feature in the overview of [nullable reference types](../nullable-references.md). Try it yourself in a new application in this [nullable reference types tutorial](tutorials/nullable-reference-types.md). Learn about the steps to migrate an existing codebase to make use of nullable reference types in the [migrating an application to use nullable reference types tutorial](tutorials/upgrade-to-nullable-references.md). ## Asynchronous streams @@ -385,7 +385,7 @@ await foreach (var number in GenerateSequence()) } ``` -You can try asynchronous streams yourself in our tutorial on [creating and consuming async streams](../tutorials/generate-consume-asynchronous-stream.md). By default, stream elements are processed in the captured context. If you want to disable capturing of the context, use the extension method. For more information about synchronization contexts and capturing the current context, see the article on [consuming the Task-based asynchronous pattern](../../standard/asynchronous-programming-patterns/consuming-the-task-based-asynchronous-pattern.md). +You can try asynchronous streams yourself in our tutorial on [creating and consuming async streams](tutorials/generate-consume-asynchronous-stream.md). By default, stream elements are processed in the captured context. If you want to disable capturing of the context, use the extension method. For more information about synchronization contexts and capturing the current context, see the article on [consuming the Task-based asynchronous pattern](../../standard/asynchronous-programming-patterns/consuming-the-task-based-asynchronous-pattern.md). ## Asynchronous disposable @@ -463,9 +463,9 @@ The range can then be used inside the `[` and `]` characters: var text = words[phrase]; ``` -Not only arrays support indices and ranges. You can also use indices and ranges with [string](../language-reference/builtin-types/reference-types.md#the-string-type), , or . For more information, see [Type support for indices and ranges](../tutorials/ranges-indexes.md#type-support-for-indices-and-ranges). +Not only arrays support indices and ranges. You can also use indices and ranges with [string](../language-reference/builtin-types/reference-types.md#the-string-type), , or . For more information, see [Type support for indices and ranges](tutorials/ranges-indexes.md#type-support-for-indices-and-ranges). -You can explore more about indices and ranges in the tutorial on [indices and ranges](../tutorials/ranges-indexes.md). +You can explore more about indices and ranges in the tutorial on [indices and ranges](tutorials/ranges-indexes.md). ## Null-coalescing assignment diff --git a/docs/csharp/whats-new/csharp-9.md b/docs/csharp/whats-new/csharp-9.md index c36c4bb56a23e..b30c557e6675e 100644 --- a/docs/csharp/whats-new/csharp-9.md +++ b/docs/csharp/whats-new/csharp-9.md @@ -104,7 +104,7 @@ The previous line creates a new `Person` record where the `LastName` property is Any of the synthesized members except the "clone" method may be written by you. If a record type has a method that matches the signature of any synthesized method, the compiler doesn't synthesize that method. The earlier `Dog` record example contains a hand coded method as an example. -Learn more about record types in this [exploration of records](../tutorials/exploration/records.md) tutorial. +Learn more about record types in this [exploration of records](../whats-new/tutorials/records.md) tutorial. ## Init only setters diff --git a/docs/csharp/tutorials/default-interface-methods-versions.md b/docs/csharp/whats-new/tutorials/default-interface-methods-versions.md similarity index 100% rename from docs/csharp/tutorials/default-interface-methods-versions.md rename to docs/csharp/whats-new/tutorials/default-interface-methods-versions.md diff --git a/docs/csharp/tutorials/generate-consume-asynchronous-stream.md b/docs/csharp/whats-new/tutorials/generate-consume-asynchronous-stream.md similarity index 99% rename from docs/csharp/tutorials/generate-consume-asynchronous-stream.md rename to docs/csharp/whats-new/tutorials/generate-consume-asynchronous-stream.md index e808ce0d283ee..7a87c3ec3d75c 100644 --- a/docs/csharp/tutorials/generate-consume-asynchronous-stream.md +++ b/docs/csharp/whats-new/tutorials/generate-consume-asynchronous-stream.md @@ -126,7 +126,7 @@ try } ``` -By default, stream elements are processed in the captured context. If you want to disable capturing of the context, use the extension method. For more information about synchronization contexts and capturing the current context, see the article on [consuming the Task-based asynchronous pattern](../../standard/asynchronous-programming-patterns/consuming-the-task-based-asynchronous-pattern.md). +By default, stream elements are processed in the captured context. If you want to disable capturing of the context, use the extension method. For more information about synchronization contexts and capturing the current context, see the article on [consuming the Task-based asynchronous pattern](../../../standard/asynchronous-programming-patterns/consuming-the-task-based-asynchronous-pattern.md). Async streams support cancellation using the same protocol as other `async` methods. You would modify the signature for the async iterator method as follows to support cancellation: diff --git a/docs/csharp/tutorials/mixins-with-default-interface-methods.md b/docs/csharp/whats-new/tutorials/mixins-with-default-interface-methods.md similarity index 93% rename from docs/csharp/tutorials/mixins-with-default-interface-methods.md rename to docs/csharp/whats-new/tutorials/mixins-with-default-interface-methods.md index 0c06c1d6fec4c..c95fbe7313caa 100644 --- a/docs/csharp/tutorials/mixins-with-default-interface-methods.md +++ b/docs/csharp/whats-new/tutorials/mixins-with-default-interface-methods.md @@ -22,11 +22,11 @@ You’ll need to set up your machine to run .NET Core, including the C# 8.0 comp ## Limitations of extension methods -One way you can implement behavior that appears as part of an interface is to define [extension methods](../programming-guide/classes-and-structs/extension-methods.md) that provide the default behavior. Interfaces declare a minimum set of members while providing a greater surface area for any class that implements that interface. For example, the extension methods in provide the implementation for any sequence to be the source of a LINQ query. +One way you can implement behavior that appears as part of an interface is to define [extension methods](../../programming-guide/classes-and-structs/extension-methods.md) that provide the default behavior. Interfaces declare a minimum set of members while providing a greater surface area for any class that implements that interface. For example, the extension methods in provide the implementation for any sequence to be the source of a LINQ query. Extension methods are resolved at compile time, using the declared type of the variable. Classes that implement the interface can provide a better implementation for any extension method. Variable declarations must match the implementing type to enable the compiler to choose that implementation. When the compile-time type matches the interface, method calls resolve to the extension method. Another concern with extension methods is that those methods are accessible wherever the class containing the extension methods is accessible. Classes cannot declare if they should or should not provide features declared in extension methods. -Starting with C# 8.0, you can declare the default implementations as interface methods. Then, every class automatically uses the default implementation. Any class that can provide a better implementation can override the interface method definition with a better algorithm. In one sense, this technique sounds similar to how you could use [extension methods](../programming-guide/classes-and-structs/extension-methods.md). +Starting with C# 8.0, you can declare the default implementations as interface methods. Then, every class automatically uses the default implementation. Any class that can provide a better implementation can override the interface method definition with a better algorithm. In one sense, this technique sounds similar to how you could use [extension methods](../../programming-guide/classes-and-structs/extension-methods.md). In this article, you'll learn how default interface implementations enable new scenarios. @@ -97,7 +97,7 @@ The `HalogenLight` you created earlier doesn't support blinking. So, don't add t ## Detect the light types using pattern matching -Next, let's write some test code. You can make use of C#'s [pattern matching](../pattern-matching.md) feature to determine a light's capabilities by examining which interfaces it supports. The following method exercises the supported capabilities of each light: +Next, let's write some test code. You can make use of C#'s [pattern matching](../../pattern-matching.md) feature to determine a light's capabilities by examining which interfaces it supports. The following method exercises the supported capabilities of each light: [!code-csharp[Test a light's capabilities](./snippets/mixins-with-default-interface-methods/Program.cs?name=SnippetTestLightFunctions)] diff --git a/docs/csharp/tutorials/nullable-reference-types.md b/docs/csharp/whats-new/tutorials/nullable-reference-types.md similarity index 95% rename from docs/csharp/tutorials/nullable-reference-types.md rename to docs/csharp/whats-new/tutorials/nullable-reference-types.md index c5bf617945e8d..24fbf1b2444a1 100644 --- a/docs/csharp/tutorials/nullable-reference-types.md +++ b/docs/csharp/whats-new/tutorials/nullable-reference-types.md @@ -7,7 +7,7 @@ ms.custom: mvc --- # Tutorial: Express your design intent more clearly with nullable and non-nullable reference types -C# 8.0 introduces [nullable reference types](../nullable-references.md), which complement reference types the same way nullable value types complement value types. You declare a variable to be a **nullable reference type** by appending a `?` to the type. For example, `string?` represents a nullable `string`. You can use these new types to more clearly express your design intent: some variables *must always have a value*, others *may be missing a value*. +C# 8.0 introduces [nullable reference types](../../nullable-references.md), which complement reference types the same way nullable value types complement value types. You declare a variable to be a **nullable reference type** by appending a `?` to the type. For example, `string?` represents a nullable `string`. You can use these new types to more clearly express your design intent: some variables *must always have a value*, others *may be missing a value*. In this tutorial, you'll learn how to: @@ -206,7 +206,7 @@ You don't need any `null` checks in this code because you've designed the underl ## Get the code -You can get the code for the finished tutorial from our [samples](https://github.com/dotnet/samples) repository in the [csharp/NullableIntroduction](https://github.com/dotnet/samples/tree/master/csharp/NullableIntroduction) folder. +You can get the code for the finished tutorial from our [samples](https://github.com/dotnet/samples) repository in the [csharp/NullableIntroduction](https://github.com/dotnet/samples/tree/main/csharp/NullableIntroduction) folder. Experiment by changing the type declarations between nullable and non-nullable reference types. See how that generates different warnings to ensure you don't accidentally dereference a `null`. diff --git a/docs/csharp/tutorials/exploration/patterns-objects.md b/docs/csharp/whats-new/tutorials/patterns-objects.md similarity index 100% rename from docs/csharp/tutorials/exploration/patterns-objects.md rename to docs/csharp/whats-new/tutorials/patterns-objects.md diff --git a/docs/csharp/tutorials/ranges-indexes.md b/docs/csharp/whats-new/tutorials/ranges-indexes.md similarity index 95% rename from docs/csharp/tutorials/ranges-indexes.md rename to docs/csharp/whats-new/tutorials/ranges-indexes.md index aa1ccf0de72ce..0f74c0141b898 100644 --- a/docs/csharp/tutorials/ranges-indexes.md +++ b/docs/csharp/whats-new/tutorials/ranges-indexes.md @@ -74,7 +74,7 @@ The following sample shows many of the reasons for those choices. Modify `x`, `y Indexes and ranges provide clear, concise syntax to access a single element or a range of elements in a sequence. An index expression typically returns the type of the elements of a sequence. A range expression typically returns the same sequence type as the source sequence. -Any type that provides an [indexer](../programming-guide/indexers/index.md) with an or parameter explicitly supports indices or ranges respectively. An indexer that takes a single parameter may return a different sequence type, such as . +Any type that provides an [indexer](../../programming-guide/indexers/index.md) with an or parameter explicitly supports indices or ranges respectively. An indexer that takes a single parameter may return a different sequence type, such as . > [!IMPORTANT] > The performance of code using the range operator depends on the type of the sequence operand. diff --git a/docs/csharp/tutorials/exploration/records.md b/docs/csharp/whats-new/tutorials/records.md similarity index 100% rename from docs/csharp/tutorials/exploration/records.md rename to docs/csharp/whats-new/tutorials/records.md diff --git a/docs/csharp/tutorials/snippets/generate-consume-asynchronous-streams/finished/IssuePRreport.csproj b/docs/csharp/whats-new/tutorials/snippets/generate-consume-asynchronous-streams/finished/IssuePRreport.csproj similarity index 100% rename from docs/csharp/tutorials/snippets/generate-consume-asynchronous-streams/finished/IssuePRreport.csproj rename to docs/csharp/whats-new/tutorials/snippets/generate-consume-asynchronous-streams/finished/IssuePRreport.csproj diff --git a/docs/csharp/tutorials/snippets/generate-consume-asynchronous-streams/finished/Program.cs b/docs/csharp/whats-new/tutorials/snippets/generate-consume-asynchronous-streams/finished/Program.cs similarity index 100% rename from docs/csharp/tutorials/snippets/generate-consume-asynchronous-streams/finished/Program.cs rename to docs/csharp/whats-new/tutorials/snippets/generate-consume-asynchronous-streams/finished/Program.cs diff --git a/docs/csharp/tutorials/snippets/generate-consume-asynchronous-streams/start/IssuePRreport.csproj b/docs/csharp/whats-new/tutorials/snippets/generate-consume-asynchronous-streams/start/IssuePRreport.csproj similarity index 100% rename from docs/csharp/tutorials/snippets/generate-consume-asynchronous-streams/start/IssuePRreport.csproj rename to docs/csharp/whats-new/tutorials/snippets/generate-consume-asynchronous-streams/start/IssuePRreport.csproj diff --git a/docs/csharp/tutorials/snippets/generate-consume-asynchronous-streams/start/Program.cs b/docs/csharp/whats-new/tutorials/snippets/generate-consume-asynchronous-streams/start/Program.cs similarity index 100% rename from docs/csharp/tutorials/snippets/generate-consume-asynchronous-streams/start/Program.cs rename to docs/csharp/whats-new/tutorials/snippets/generate-consume-asynchronous-streams/start/Program.cs diff --git a/docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/ExtraFancyLight.cs b/docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/ExtraFancyLight.cs similarity index 100% rename from docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/ExtraFancyLight.cs rename to docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/ExtraFancyLight.cs diff --git a/docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/HalogenLight.cs b/docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/HalogenLight.cs similarity index 100% rename from docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/HalogenLight.cs rename to docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/HalogenLight.cs diff --git a/docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/IBlinkingLight.cs b/docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/IBlinkingLight.cs similarity index 100% rename from docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/IBlinkingLight.cs rename to docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/IBlinkingLight.cs diff --git a/docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/ILight.cs b/docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/ILight.cs similarity index 100% rename from docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/ILight.cs rename to docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/ILight.cs diff --git a/docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/ITimerLight.cs b/docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/ITimerLight.cs similarity index 100% rename from docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/ITimerLight.cs rename to docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/ITimerLight.cs diff --git a/docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/LEDLight.cs b/docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/LEDLight.cs similarity index 100% rename from docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/LEDLight.cs rename to docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/LEDLight.cs diff --git a/docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/OverheadLight.cs b/docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/OverheadLight.cs similarity index 100% rename from docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/OverheadLight.cs rename to docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/OverheadLight.cs diff --git a/docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/Program.cs b/docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/Program.cs similarity index 100% rename from docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/Program.cs rename to docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/Program.cs diff --git a/docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/UnusedExampleCode.cs b/docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/UnusedExampleCode.cs similarity index 100% rename from docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/UnusedExampleCode.cs rename to docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/UnusedExampleCode.cs diff --git a/docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/mixins-with-interfaces.csproj b/docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/mixins-with-interfaces.csproj similarity index 100% rename from docs/csharp/tutorials/snippets/mixins-with-default-interface-methods/mixins-with-interfaces.csproj rename to docs/csharp/whats-new/tutorials/snippets/mixins-with-default-interface-methods/mixins-with-interfaces.csproj diff --git a/docs/csharp/tutorials/exploration/snippets/pattern-objects/CanalLock.cs b/docs/csharp/whats-new/tutorials/snippets/pattern-objects/CanalLock.cs similarity index 100% rename from docs/csharp/tutorials/exploration/snippets/pattern-objects/CanalLock.cs rename to docs/csharp/whats-new/tutorials/snippets/pattern-objects/CanalLock.cs diff --git a/docs/csharp/tutorials/exploration/snippets/pattern-objects/InterimSteps.cs b/docs/csharp/whats-new/tutorials/snippets/pattern-objects/InterimSteps.cs similarity index 100% rename from docs/csharp/tutorials/exploration/snippets/pattern-objects/InterimSteps.cs rename to docs/csharp/whats-new/tutorials/snippets/pattern-objects/InterimSteps.cs diff --git a/docs/csharp/tutorials/exploration/snippets/pattern-objects/Program.cs b/docs/csharp/whats-new/tutorials/snippets/pattern-objects/Program.cs similarity index 100% rename from docs/csharp/tutorials/exploration/snippets/pattern-objects/Program.cs rename to docs/csharp/whats-new/tutorials/snippets/pattern-objects/Program.cs diff --git a/docs/csharp/tutorials/exploration/snippets/pattern-objects/pattern-objects.csproj b/docs/csharp/whats-new/tutorials/snippets/pattern-objects/pattern-objects.csproj similarity index 100% rename from docs/csharp/tutorials/exploration/snippets/pattern-objects/pattern-objects.csproj rename to docs/csharp/whats-new/tutorials/snippets/pattern-objects/pattern-objects.csproj diff --git a/docs/csharp/tutorials/exploration/snippets/record-types/DailyTemperature.cs b/docs/csharp/whats-new/tutorials/snippets/record-types/DailyTemperature.cs similarity index 100% rename from docs/csharp/tutorials/exploration/snippets/record-types/DailyTemperature.cs rename to docs/csharp/whats-new/tutorials/snippets/record-types/DailyTemperature.cs diff --git a/docs/csharp/tutorials/exploration/snippets/record-types/DegreeDays.cs b/docs/csharp/whats-new/tutorials/snippets/record-types/DegreeDays.cs similarity index 100% rename from docs/csharp/tutorials/exploration/snippets/record-types/DegreeDays.cs rename to docs/csharp/whats-new/tutorials/snippets/record-types/DegreeDays.cs diff --git a/docs/csharp/tutorials/exploration/snippets/record-types/InterimSteps.cs b/docs/csharp/whats-new/tutorials/snippets/record-types/InterimSteps.cs similarity index 100% rename from docs/csharp/tutorials/exploration/snippets/record-types/InterimSteps.cs rename to docs/csharp/whats-new/tutorials/snippets/record-types/InterimSteps.cs diff --git a/docs/csharp/tutorials/exploration/snippets/record-types/Program.cs b/docs/csharp/whats-new/tutorials/snippets/record-types/Program.cs similarity index 100% rename from docs/csharp/tutorials/exploration/snippets/record-types/Program.cs rename to docs/csharp/whats-new/tutorials/snippets/record-types/Program.cs diff --git a/docs/csharp/tutorials/exploration/snippets/record-types/record-types.csproj b/docs/csharp/whats-new/tutorials/snippets/record-types/record-types.csproj similarity index 100% rename from docs/csharp/tutorials/exploration/snippets/record-types/record-types.csproj rename to docs/csharp/whats-new/tutorials/snippets/record-types/record-types.csproj diff --git a/docs/csharp/tutorials/exploration/snippets/top-level-statements/Program.cs b/docs/csharp/whats-new/tutorials/snippets/top-level-statements/Program.cs similarity index 100% rename from docs/csharp/tutorials/exploration/snippets/top-level-statements/Program.cs rename to docs/csharp/whats-new/tutorials/snippets/top-level-statements/Program.cs diff --git a/docs/csharp/tutorials/exploration/snippets/top-level-statements/ProgramSnippets.cs b/docs/csharp/whats-new/tutorials/snippets/top-level-statements/ProgramSnippets.cs similarity index 100% rename from docs/csharp/tutorials/exploration/snippets/top-level-statements/ProgramSnippets.cs rename to docs/csharp/whats-new/tutorials/snippets/top-level-statements/ProgramSnippets.cs diff --git a/docs/csharp/tutorials/exploration/snippets/top-level-statements/Properties/launchSettings.json b/docs/csharp/whats-new/tutorials/snippets/top-level-statements/Properties/launchSettings.json similarity index 100% rename from docs/csharp/tutorials/exploration/snippets/top-level-statements/Properties/launchSettings.json rename to docs/csharp/whats-new/tutorials/snippets/top-level-statements/Properties/launchSettings.json diff --git a/docs/csharp/tutorials/exploration/snippets/top-level-statements/TopLevelStatements.csproj b/docs/csharp/whats-new/tutorials/snippets/top-level-statements/TopLevelStatements.csproj similarity index 100% rename from docs/csharp/tutorials/exploration/snippets/top-level-statements/TopLevelStatements.csproj rename to docs/csharp/whats-new/tutorials/snippets/top-level-statements/TopLevelStatements.csproj diff --git a/docs/csharp/tutorials/exploration/snippets/top-level-statements/Utilities.cs b/docs/csharp/whats-new/tutorials/snippets/top-level-statements/Utilities.cs similarity index 100% rename from docs/csharp/tutorials/exploration/snippets/top-level-statements/Utilities.cs rename to docs/csharp/whats-new/tutorials/snippets/top-level-statements/Utilities.cs diff --git a/docs/csharp/tutorials/exploration/snippets/top-level-statements/UtilitiesPassOne.cs b/docs/csharp/whats-new/tutorials/snippets/top-level-statements/UtilitiesPassOne.cs similarity index 100% rename from docs/csharp/tutorials/exploration/snippets/top-level-statements/UtilitiesPassOne.cs rename to docs/csharp/whats-new/tutorials/snippets/top-level-statements/UtilitiesPassOne.cs diff --git a/docs/csharp/tutorials/exploration/top-level-statements.md b/docs/csharp/whats-new/tutorials/top-level-statements.md similarity index 100% rename from docs/csharp/tutorials/exploration/top-level-statements.md rename to docs/csharp/whats-new/tutorials/top-level-statements.md diff --git a/docs/csharp/tutorials/upgrade-to-nullable-references.md b/docs/csharp/whats-new/tutorials/upgrade-to-nullable-references.md similarity index 100% rename from docs/csharp/tutorials/upgrade-to-nullable-references.md rename to docs/csharp/whats-new/tutorials/upgrade-to-nullable-references.md diff --git a/docs/devops/create-dotnet-github-action.md b/docs/devops/create-dotnet-github-action.md index 0c53c3a4ccf26..04edd0fce08de 100644 --- a/docs/devops/create-dotnet-github-action.md +++ b/docs/devops/create-dotnet-github-action.md @@ -60,7 +60,7 @@ With the defined action inputs class, focus on the *Program.cs* file. The `Program` file is simplified for brevity, to explore the full sample source, see [*Program.cs*](https://github.com/dotnet/samples/blob/main/github-actions/DotNet.GitHubAction/DotNet.GitHubAction/Program.cs). The mechanics in place demonstrate the boilerplate code required to use: -- [Top-level statements](../csharp/tutorials/exploration/top-level-statements.md) +- [Top-level statements](../csharp/whats-new/tutorials/top-level-statements.md) - [Generic Host](../core/extensions/generic-host.md) - [Dependency injection](../core/extensions/dependency-injection.md) diff --git a/docs/fsharp/whats-new/fsharp-50.md b/docs/fsharp/whats-new/fsharp-50.md index 4041a1a434e23..e0f3f0c19e897 100644 --- a/docs/fsharp/whats-new/fsharp-50.md +++ b/docs/fsharp/whats-new/fsharp-50.md @@ -231,12 +231,14 @@ F# 5.0 brings support for slicing with a fixed index in the built-in 3D and 4D a To illustrate this, consider the following 3D array: *z = 0* + | x\y | 0 | 1 | |-------|---|---| | **0** | 0 | 1 | | **1** | 2 | 3 | *z = 1* + | x\y | 0 | 1 | |-------|---|---| | **0** | 4 | 5 | @@ -360,7 +362,7 @@ This feature implements [F# RFC FS-1031](https://github.com/fsharp/fslang-design ## Default interface member consumption -F# 5 lets you consume [interfaces with default implementations](../../csharp/tutorials/default-interface-methods-versions.md). +F# 5 lets you consume [interfaces with default implementations](../../csharp/whats-new/tutorials/default-interface-methods-versions.md). Consider an interface defined in C# like this: diff --git a/docs/whats-new/2020-10.md b/docs/whats-new/2020-10.md index 79ede5ece45fa..cbbf3457ee944 100644 --- a/docs/whats-new/2020-10.md +++ b/docs/whats-new/2020-10.md @@ -45,8 +45,8 @@ You can download the latest .NET SDK from the [.NET downloads page](https://dotn ### New articles - [with expression (C# reference)](../csharp/language-reference/operators/with-expression.md) - C# 9 reference update: a with expression -- [Use pattern matching to build your class behavior for better code](../csharp/tutorials/exploration/patterns-objects.md) - Pattern tutorial -- [Tutorial: Explore ideas using top-level statements to build code as you learn](../csharp/tutorials/exploration/top-level-statements.md) - Top level statements tutorial +- [Use pattern matching to build your class behavior for better code](../csharp/whats-new/tutorials/patterns-objects.md) - Pattern tutorial +- [Tutorial: Explore ideas using top-level statements to build code as you learn](../csharp/whats-new/tutorials/top-level-statements.md) - Top level statements tutorial - [Object-Oriented programming (C#)](../csharp/tutorials/intro-to-csharp/object-oriented-programming.md) - move OO tutorial to get-started ### Updated articles diff --git a/docs/whats-new/2020-11.md b/docs/whats-new/2020-11.md index d29193d594171..f936c56be61f5 100644 --- a/docs/whats-new/2020-11.md +++ b/docs/whats-new/2020-11.md @@ -86,21 +86,21 @@ Welcome to what's new in the .NET docs for November 2020. This article lists som ### New articles -- [What's new (Windows Forms .NET)](/dotnet/desktop/winforms/whats-new/?view=netdesktop-5.0) - Add what's new in WinForms article +- [What's new (Windows Forms .NET)](/dotnet/desktop/winforms/whats-new/?view=netdesktop-5.0&preserve-view=true) - Add what's new in WinForms article ### Updated articles -- [How to migrate a Windows Forms desktop app to .NET 5](/dotnet/desktop/winforms/migration/?view=netdesktop-5.0) - Add Visual Basic notes to WinForms migration article -- [Desktop guide](/dotnet/desktop/?view=netdesktop-5.0) - Fix multiple related to open issues. +- [How to migrate a Windows Forms desktop app to .NET 5](/dotnet/desktop/winforms/migration/?view=netdesktop-5.0&preserve-view=true) - Add Visual Basic notes to WinForms migration article +- [Desktop guide](/dotnet/desktop/?view=netdesktop-5.0&preserve-view=true) - Fix multiple related to open issues. ## C# language ### New articles - [#nullable (C# Reference)](../csharp/language-reference/preprocessor-directives/preprocessor-nullable.md) - explain how nullable attributes are handled in generated files -- [Create record types](../csharp/tutorials/exploration/records.md) - Tutorial: explore record types +- [Create record types](../csharp/whats-new/tutorials/records.md) - Tutorial: explore record types - [with expression (C# reference)](../csharp/language-reference/operators/with-expression.md) - C# 9 reference update: `with` expression -- [Use pattern matching to build your class behavior for better code](../csharp/tutorials/exploration/patterns-objects.md) - Pattern tutorial +- [Use pattern matching to build your class behavior for better code](../csharp/whats-new/tutorials/patterns-objects.md) - Pattern tutorial ### Updated articles