Skip to content

Commit

Permalink
fix links.
Browse files Browse the repository at this point in the history
  • Loading branch information
BillWagner committed Nov 15, 2024
1 parent 0cf3446 commit 06ea9f3
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Default projects should compile.

If you relied on the implicit global `using` directive, you can:

- Add a [global `using` directive](../../../../csharp/language-reference/keywords/using-directive.md#global-modifier) to one of your source files.
- Add a [global `using` directive](../../../../csharp/language-reference/keywords/using-directive.md#the-global-modifier) to one of your source files.
- Add a `using` directive to each source code file that uses APIs from System.Net.Http.

## Affected APIs
Expand Down
4 changes: 2 additions & 2 deletions docs/core/project-sdk/msbuild-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,7 @@ For more information, see [Trimming options](../deploying/trimming/trimming-opti

### Using

The `Using` item lets you [globally include a namespace](../../csharp/language-reference/keywords/using-directive.md#global-modifier) across your C# project, such that you don't have to add a `using` directive for the namespace at the top of your source files. This item is similar to the `Import` item that can be used for the same purpose in Visual Basic projects. This property is available starting in .NET 6.
The `Using` item lets you [globally include a namespace](../../csharp/language-reference/keywords/using-directive.md#the-global-modifier) across your C# project, such that you don't have to add a `using` directive for the namespace at the top of your source files. This item is similar to the `Import` item that can be used for the same purpose in Visual Basic projects. This property is available starting in .NET 6.

```xml
<ItemGroup>
Expand All @@ -1772,7 +1772,7 @@ For example:
- `<Using Include="Microsoft.AspNetCore.Http.Results" Alias="Results" />` emits `global using Results = global::Microsoft.AspNetCore.Http.Results;`
- `<Using Include="Microsoft.AspNetCore.Http.Results" Static="True" />` emits `global using static global::Microsoft.AspNetCore.Http.Results;`

For more information, see [aliased `using` directives](../../csharp/language-reference/keywords/using-directive.md#using-alias) and [`using static <type>` directives](../../csharp/language-reference/keywords/using-directive.md#static-modifier).
For more information, see [aliased `using` directives](../../csharp/language-reference/keywords/using-directive.md#the-using-alias) and [`using static <type>` directives](../../csharp/language-reference/keywords/using-directive.md#the-static-modifier).

## Item metadata

Expand Down
2 changes: 1 addition & 1 deletion docs/core/project-sdk/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ If you explicitly define any of these items in your project file, you're likely

## Implicit using directives

Starting in .NET 6, implicit [`global using` directives](../../csharp/language-reference/keywords/using-directive.md#global-modifier) are added to new C# projects. This means that you can use types defined in these namespaces without having to specify their fully qualified name or manually add a `using` directive. The *implicit* aspect refers to the fact that the `global using` directives are added to a generated file in the project's *obj* directory.
Starting in .NET 6, implicit [`global using` directives](../../csharp/language-reference/keywords/using-directive.md#the-global-modifier) are added to new C# projects. This means that you can use types defined in these namespaces without having to specify their fully qualified name or manually add a `using` directive. The *implicit* aspect refers to the fact that the `global using` directives are added to a generated file in the project's *obj* directory.

Implicit `global using` directives are added for projects that use one of the following SDKs:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ At compile time, the compiler replaces non-default field names with the correspo
> [!TIP]
> Enable .NET code style rule [IDE0037](../../../fundamentals/code-analysis/style-rules/ide0037.md) to set a preference on inferred or explicit tuple field names.
Beginning with C# 12, you can specify an alias for a tuple type with a [`using` directive](../keywords/using-directive.md#using-alias). The following example adds a `global using` alias for a tuple type with two integer values for an allowed `Min` and `Max` value:
Beginning with C# 12, you can specify an alias for a tuple type with a [`using` directive](../keywords/using-directive.md#the-using-alias). The following example adds a `global using` alias for a tuple type with two integer values for an allowed `Min` and `Max` value:

:::code language="csharp" source="snippets/shared/ValueTuples.cs" id="AliasTupleType":::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ In addition, if you define an alias named `global`, the compiler issues **CS0440

## Alias name conflicts

You can declare an [alias](../keywords/using-directive.md#using-alias) to a namespace or a type with a `using` directive:
You can declare an [alias](../keywords/using-directive.md#the-using-alias) to a namespace or a type with a `using` directive:

:::code language="csharp" source="./snippets/UsingDirectives/Program.cs" id="UsingAlias":::

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/linq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The following example shows a complete query operation. The complete operation i

:::code language="csharp" source="./snippets/linq-index/Index.cs" id="intro":::

You might need to add a [`using`](../language-reference/keywords/using-directive.md) directive, `using System.Linq;`, for the preceding example to compile. The most recent versions of .NET make use of [implicit usings](../../core/project-sdk/overview.md#implicit-using-directives) to add this directive as a [global using](../language-reference/keywords/using-directive.md#global-modifier). Older versions require you to add it in your source.
You might need to add a [`using`](../language-reference/keywords/using-directive.md) directive, `using System.Linq;`, for the preceding example to compile. The most recent versions of .NET make use of [implicit usings](../../core/project-sdk/overview.md#implicit-using-directives) to add this directive as a [global using](../language-reference/keywords/using-directive.md#the-global-modifier). Older versions require you to add it in your source.

## Query expression overview

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/tour-of-csharp/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The preceding example shows one form of a "Hello, World" program, using [top-lev

:::code language="csharp" interactive="try-dotnet" source="./snippets/shared/HelloWorld.cs":::

This version shows the building blocks you use in your programs. The "Hello, World" program starts with a `using` directive that references the `System` namespace. Namespaces provide a hierarchical means of organizing C# programs and libraries. Namespaces contain types and other namespaces—for example, the `System` namespace contains many types, such as the `Console` class referenced in the program, and many other namespaces, such as `IO` and `Collections`. A `using` directive that references a given namespace enables unqualified use of the types that are members of that namespace. Because of the `using` directive, the program can use `Console.WriteLine` as shorthand for `System.Console.WriteLine`. In the earlier example, that namespace was [implicitly](../language-reference/keywords/using-directive.md#global-modifier) included.
This version shows the building blocks you use in your programs. The "Hello, World" program starts with a `using` directive that references the `System` namespace. Namespaces provide a hierarchical means of organizing C# programs and libraries. Namespaces contain types and other namespaces—for example, the `System` namespace contains many types, such as the `Console` class referenced in the program, and many other namespaces, such as `IO` and `Collections`. A `using` directive that references a given namespace enables unqualified use of the types that are members of that namespace. Because of the `using` directive, the program can use `Console.WriteLine` as shorthand for `System.Console.WriteLine`. In the earlier example, that namespace was [implicitly](../language-reference/keywords/using-directive.md#the-global-modifier) included.

The `Hello` class declared by the "Hello, World" program has a single member, the method named `Main`. The `Main` method is declared with the `static` modifier. While instance methods can reference a particular enclosing object instance using the keyword `this`, static methods operate without reference to a particular object. By convention, when there are no top-level statements a static method named `Main` serves as the [entry point](../fundamentals/program-structure/main-command-line.md) of a C# program.

Expand Down

0 comments on commit 06ea9f3

Please sign in to comment.