Skip to content

Commit

Permalink
Merge pull request #39848 from dotnet/main
Browse files Browse the repository at this point in the history
  • Loading branch information
BillWagner authored Mar 7, 2024
2 parents e5201d2 + 17011ce commit e47782f
Show file tree
Hide file tree
Showing 19 changed files with 153 additions and 94 deletions.
19 changes: 10 additions & 9 deletions docs/azure/includes/dotnet-all.md

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions docs/azure/includes/dotnet-new.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/core/deploying/deploy-with-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Publishing an FDE creates an app that automatically rolls-forward to the latest

Whenever you use the `-r` switch, the output folder path changes to: `./bin/<BUILD-CONFIGURATION>/<TFM>/<RID>/publish/`

If you use the [example app](#sample-app), run `dotnet publish -f net6.0 -r win10-x64 --self-contained false`. This command creates the following executable: `./bin/Debug/net6.0/win10-x64/publish/apptest1.exe`
If you use the [example app](#sample-app), run `dotnet publish -f net6.0 -r win-x64 --self-contained false`. This command creates the following executable: `./bin/Debug/net6.0/win-x64/publish/apptest1.exe`

> [!NOTE]
> You can reduce the total size of your deployment by enabling **globalization invariant mode**. This mode is useful for applications that are not globally aware and that can use the formatting conventions, casing conventions, and string comparison and sort order of the [invariant culture](xref:System.Globalization.CultureInfo.InvariantCulture). For more information about **globalization invariant mode** and how to enable it, see [.NET Globalization Invariant Mode](https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md).
Expand Down
14 changes: 7 additions & 7 deletions docs/core/deploying/deploy-with-vs.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ To publish your app from Visual Studio, do the following:

1. Create a `<RuntimeIdentifiers>` tag in the `<PropertyGroup>` section of your *csproj* file that defines the platforms your app targets, and specify the runtime identifier (RID) of each platform that you target. You also need to add a semicolon to separate the RIDs. See [Runtime identifier catalog](../rid-catalog.md) for a list of runtime identifiers.

For example, the following example indicates that the app runs on 64-bit Windows 10 operating systems and the 64-bit OS X Version 10.11 operating system.
For example, the following example indicates that the app runs on 64-bit Windows operating systems and the 64-bit OS X operating system.

```xml
<PropertyGroup>
<RuntimeIdentifiers>win10-x64;osx.10.11-x64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
</PropertyGroup>
```

Expand All @@ -142,13 +142,13 @@ To publish your app from Visual Studio, do the following:

1. Select **Create new profile** in the **Publish** dialog.

1. In the **Pick a publish target** dialog, change the **Choose a folder** location to *bin\Release\PublishOutput\win10-x64*. Select **OK**.
1. In the **Pick a publish target** dialog, change the **Choose a folder** location to *bin\Release\PublishOutput\win-x64*. Select **OK**.

1. Select the new profile (**FolderProfile1**) in the list of profiles, and make sure that the **Target Runtime** is `win10-x64`. If it isn't, select **Settings**. In the **Profile Settings** dialog, change the **Target Runtime** to `win10-x64` and select **Save**. Otherwise, select **Cancel**.
1. Select the new profile (**FolderProfile1**) in the list of profiles, and make sure that the **Target Runtime** is `win-x64`. If it isn't, select **Settings**. In the **Profile Settings** dialog, change the **Target Runtime** to `win-x64` and select **Save**. Otherwise, select **Cancel**.

1. Select **Publish** to publish your app for 64-bit Windows 10 platforms.

1. Follow the previous steps again to create a profile for the `osx.10.11-x64` platform. The **Target Location** is *bin\Release\PublishOutput\osx.10.11-x64*, and the **Target Runtime** is `osx.10.11-x64`. The name that Visual Studio assigns to this profile is **FolderProfile2**.
1. Follow the previous steps again to create a profile for the `osx-x64` platform. The **Target Location** is *bin\Release\PublishOutput\osx-x64*, and the **Target Runtime** is `osx-x64`. The name that Visual Studio assigns to this profile is **FolderProfile2**.

Each target location contains the complete set of files (both your app files and all .NET Core files) needed to launch your app.

Expand All @@ -163,7 +163,7 @@ The following is the complete *csproj* file for this project.
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RuntimeIdentifiers>win10-x64;osx.10.11-x64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
</PropertyGroup>
</Project>
```
Expand Down Expand Up @@ -273,7 +273,7 @@ The following is the complete *csproj* file for this project:
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RuntimeIdentifiers>win10-x64;osx.10.11-x64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x64;osx-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
Expand Down
2 changes: 1 addition & 1 deletion docs/core/deploying/runtime-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dotnet store --manifest <PATH_TO_MANIFEST_FILE> --runtime <RUNTIME_IDENTIFIER> -
**Example**

```dotnetcli
dotnet store --manifest packages.csproj --runtime win10-x64 --framework netcoreapp2.0 --framework-version 2.0.0
dotnet store --manifest packages.csproj --runtime win-x64 --framework netcoreapp2.0 --framework-version 2.0.0
```

You can pass multiple target package store manifest paths to a single [`dotnet store`](../tools/dotnet-store.md) command by repeating the option and path in the command.
Expand Down
6 changes: 3 additions & 3 deletions docs/core/project-sdk/msbuild-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ For example, for a .NET 5 app, the output path changes from `bin\Debug\net5.0` t

The `AppendRuntimeIdentifierToOutputPath` property controls whether the [runtime identifier (RID)](../rid-catalog.md) is appended to the output path. The .NET SDK automatically appends the target framework and, if present, the runtime identifier to the output path. Setting `AppendRuntimeIdentifierToOutputPath` to `false` prevents the RID from being appended to the output path.

For example, for a .NET 5 app and an RID of `win10-x64`, the output path changes from `bin\Debug\net5.0\win10-x64` to `bin\Debug\net5.0` with the following setting:
For example, for a .NET 5 app and an RID of `win-x64`, the following setting changes the output path from `bin\Debug\net5.0\win-x64` to `bin\Debug\net5.0`:

```xml
<PropertyGroup>
Expand Down Expand Up @@ -588,7 +588,7 @@ The `RuntimeIdentifier` property lets you specify a single [runtime identifier (

```xml
<PropertyGroup>
<RuntimeIdentifier>ubuntu.16.04-x64</RuntimeIdentifier>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
</PropertyGroup>
```

Expand All @@ -601,7 +601,7 @@ The `RuntimeIdentifiers` property lets you specify a semicolon-delimited list of
```xml
<PropertyGroup>
<RuntimeIdentifiers>win10-x64;osx.10.11-x64;ubuntu.16.04-x64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
</PropertyGroup>
```

Expand Down
4 changes: 2 additions & 2 deletions docs/core/tools/dotnet-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ The project or solution file to build. If a project or solution file isn't speci
dotnet build --configuration Release
```

- Build a project and its dependencies for a specific runtime (in this example, Ubuntu 18.04):
- Build a project and its dependencies for a specific runtime (in this example, Linux):

```dotnetcli
dotnet build --runtime ubuntu.18.04-x64
dotnet build --runtime linux-x64
```

- Build the project and use the specified NuGet package source during the restore operation:
Expand Down
4 changes: 2 additions & 2 deletions docs/core/tools/dotnet-msbuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ The [dotnet build](dotnet-build.md) command is equivalent to `dotnet msbuild -re
dotnet msbuild -property:Configuration=Release
```

- Run the publish target and publish for the `osx.10.11-x64` RID:
- Run the publish target and publish for the `osx-x64` RID:

```dotnetcli
dotnet msbuild -target:Publish -property:RuntimeIdentifiers=osx.10.11-x64
dotnet msbuild -target:Publish -property:RuntimeIdentifiers=osx-x64
```

- See the whole project with all targets included by the SDK:
Expand Down
4 changes: 2 additions & 2 deletions docs/core/tools/dotnet-pack.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ You can provide MSBuild properties to the `dotnet pack` command for the packing
dotnet pack -p:TargetFrameworks=net45
```

- Pack the project and use a specific runtime (Windows 10) for the restore operation:
- Pack the project and use a specific runtime (Windows) for the restore operation:

```dotnetcli
dotnet pack --runtime win10-x64
dotnet pack --runtime win-x64
```

- Pack the project using a *.nuspec* file:
Expand Down
6 changes: 3 additions & 3 deletions docs/core/tools/dotnet-publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,23 +234,23 @@ For more information, see the following resources:
- Create a [self-contained executable](../deploying/index.md#publish-self-contained) for the project in the current directory, for a specific runtime:

```dotnetcli
dotnet publish --runtime osx.10.11-x64
dotnet publish --runtime osx-x64
```

The RID must be in the project file.

- Create a [framework-dependent executable](../deploying/index.md#publish-framework-dependent) for the project in the current directory, for a specific platform:

```dotnetcli
dotnet publish --runtime osx.10.11-x64 --self-contained false
dotnet publish --runtime osx-x64 --self-contained false
```

The RID must be in the project file. This example applies to .NET Core 3.0 SDK and later versions.

- Publish the project in the current directory, for a specific runtime and target framework:

```dotnetcli
dotnet publish --framework netcoreapp3.1 --runtime osx.10.11-x64
dotnet publish --framework netcoreapp3.1 --runtime osx-x64
```

- Publish the specified project file:
Expand Down
6 changes: 3 additions & 3 deletions docs/core/versions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ The optional `PRERELEASE` and `BUILDNUMBER` parts are never part of supported re
- Significant changes in the product, or a new product direction.
- API introduced breaking changes. There's a high bar to accepting breaking changes.
- A newer `MAJOR` version of an existing dependency is adopted.

Major releases happen once a year, even-numbered versions are long-term supported (LTS) releases. The first LTS release using this versioning scheme is .NET 6. The latest non-LTS version is .NET 5.

- `MINOR` is incremented when:

- Public API surface area is added.
Expand All @@ -79,7 +79,7 @@ When there are multiple changes, the highest element affected by individual chan

## Version numbers in file names

The files downloaded for .NET carry the version, for example, `dotnet-sdk-5.0.301-win10-x64.exe`.
The files downloaded for .NET carry the version, for example, `dotnet-sdk-5.0.301-win-x64.exe`.

### Preview versions

Expand Down
8 changes: 5 additions & 3 deletions docs/csharp/linq/get-started/query-expression-basics.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Query expression basics (LINQ in C#)
description: Introduces concepts related to query expressions
ms.date: 12/14/2023
ms.date: 03/06/2024
---
# Query expression basics

Expand All @@ -21,7 +21,7 @@ Given this source sequence, a query might do one of three things:

:::code language="csharp" source="./snippets/SnippetApp/Basics.cs" id="basics1":::

- Retrieve a sequence of elements as in the previous example but transform them to a new type of object. For example, a query might retrieve only the last names from certain customer records in a data source. Or it might retrieve the complete record and then use it to construct another in-memory object type or even XML data before generating the final result sequence. The following example shows a projection from an `int` to a `string`. Note the new type of `highScoresQuery`.
- Retrieve a sequence of elements as in the previous example but transform them to a new type of object. For example, a query might retrieve only the family names from certain customer records in a data source. Or it might retrieve the complete record and then use it to construct another in-memory object type or even XML data before generating the final result sequence. The following example shows a projection from an `int` to a `string`. Note the new type of `highScoresQuery`.

:::code language="csharp" source="./snippets/SnippetApp/Basics.cs" id="basics2":::

Expand Down Expand Up @@ -52,10 +52,12 @@ A query expression must begin with a [from](../../language-reference/keywords/fr
In LINQ, a query variable is any variable that stores a *query* instead of the *results* of a query. More specifically, a query variable is always an enumerable type that produces a sequence of elements when iterated over in a `foreach` statement or a direct call to its <xref:System.Collections.IEnumerator.MoveNext?displayProperty=nameWithType> method.

> [!NOTE]
> Examples in this article uses the following data source
> Examples in this article uses the following data source and sample data.
:::code language="csharp" source="./snippets/SnippetApp/DataSources.cs" id="basics_datasource":::

:::code language="csharp" source="./snippets/SnippetApp/Basics.cs" id="SourceData":::

The following code example shows a simple query expression with one data source, one filtering clause, one ordering clause, and no transformation of the source elements. The `select` clause ends the query.

:::code language="csharp" source="./snippets/SnippetApp/Basics.cs" id="basics5":::
Expand Down
47 changes: 43 additions & 4 deletions docs/csharp/linq/get-started/snippets/SnippetApp/Basics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,44 @@

public static class Basics
{
// We're not displaying the output, so these could be filled with dummy data

static readonly int[] scores = [0]; // Max is called on this, so one value is needed
static readonly City[] cities = [new City(200000), new City(120000), new City(112000), new City(150340), new City(23000)];
static readonly Country[] countries = [];

// <SourceData>
static readonly City[] cities = [
new City("Tokyo", 37_833_000),
new City("Delhi", 30_290_000),
new City("Shanghai", 27_110_000),
new City("São Paulo", 22_043_000),
new City("Mumbai", 20_412_000),
new City("Beijing", 20_384_000),
new City("Cairo", 18_772_000),
new City("Dhaka", 17_598_000),
new City("Osaka", 19_281_000),
new City("New York-Newark", 18_604_000),
new City("Karachi", 16_094_000),
new City("Chongqing", 15_872_000),
new City("Istanbul", 15_029_000),
new City("Buenos Aires", 15_024_000),
new City("Kolkata", 14_850_000),
new City("Lagos", 14_368_000),
new City("Kinshasa", 14_342_000),
new City("Manila", 13_923_000),
new City("Rio de Janeiro", 13_374_000),
new City("Tianjin", 13_215_000)
];

static readonly Country[] countries = [
new Country ("Vatican City", 0.44, 526, [new City("Vatican City", 826)]),
new Country ("Monaco", 2.02, 38_000, [new City("Monte Carlo", 38_000)]),
new Country ("Nauru", 21, 10_900, [new City("Yaren", 1_100)]),
new Country ("Tuvalu", 26, 11_600, [new City("Funafuti", 6_200)]),
new Country ("San Marino", 61, 33_900, [new City("San Marino", 4_500)]),
new Country ("Liechtenstein", 160, 38_000, [new City("Vaduz", 5_200)]),
new Country ("Marshall Islands", 181, 58_000, [new City("Majuro", 28_000)]),
new Country ("Saint Kitts & Nevis", 261, 53_000, [new City("Basseterre", 13_000)])
];
// </SourceData>

public static void Basics1()
{
Expand Down Expand Up @@ -78,7 +112,12 @@ orderby score descending // optional
public static void Basics6()
{
// <basics6>
City[] cities = [new City(20000), new City(120000), new City(112000), new City(150340), new City(23000)];
City[] cities = [
new City("Tokyo", 37_833_000),
new City("Delhi", 30_290_000),
new City("Shanghai", 27_110_000),
new City("São Paulo", 22_043_000)
];

//Query syntax
IEnumerable<City> queryMajorCities =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace Linq.GetStarted;

// <basics_datasource>
record City(long Population);
record Country(string Name, List<City> Cities, long Area, long Population);
record City(string Name, long Population);
record Country(string Name, double Area, long Population, List<City> Cities);
record Product(string Name, string Category);
// </basics_datasource>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The previous examples have all shown instance constructors, which create a new o

The following example uses a static constructor to initialize a static field.

:::code source="./snippets/constructors/Program.cs" id="StaticExpression":::
:::code source="./snippets/constructors/Program.cs" id="StaticCtor":::

You can also define a static constructor with an expression body definition, as the following example shows.

Expand Down
Loading

0 comments on commit e47782f

Please sign in to comment.