Skip to content

Commit ded7b3d

Browse files
authored
Fixed section links to .Net DI docs (#36777)
1 parent 486b30d commit ded7b3d

File tree

10 files changed

+41
-41
lines changed

10 files changed

+41
-41
lines changed

aspnetcore/fundamentals/configuration/options.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -462,20 +462,20 @@ For the preceding code, changes to the JSON configuration in the app settings fi
462462
* Does ***not*** support:
463463
* Reading of configuration data after the app has started.
464464
* [Named options](#specify-a-custom-key-name-for-a-configuration-property-using-configurationkeyname).
465-
* Is registered as a [singleton service](/dotnet/core/extensions/dependency-injection#singleton) and can be injected into any [service lifetime](/dotnet/core/extensions/dependency-injection#service-lifetimes).
465+
* Is registered as a [singleton service](/dotnet/core/extensions/dependency-injection/service-lifetimes#singleton) and can be injected into any [service lifetime](/dotnet/core/extensions/dependency-injection/service-lifetimes).
466466

467467
<xref:Microsoft.Extensions.Options.IOptionsSnapshot%601>:
468468

469469
* Covered later in this article in the [Use `IOptionsSnapshot` to read updated data](#use-ioptionssnapshot-to-read-updated-data) section.
470470
* Is useful in scenarios where options should be recomputed on every request.
471-
* Is registered as a [scoped service](/dotnet/core/extensions/dependency-injection#scoped), so it can't be injected into a singleton service.
471+
* Is registered as a [scoped service](/dotnet/core/extensions/dependency-injection/service-lifetimes#scoped), so it can't be injected into a singleton service.
472472
* Supports [named options](#specify-a-custom-key-name-for-a-configuration-property-using-configurationkeyname).
473473

474474
<xref:Microsoft.Extensions.Options.IOptionsMonitor%601>:
475475

476476
* Covered later in this article in the [Use `IOptionsMonitor` to read updated data](#use-ioptionssnapshot-to-read-updated-data) section.
477477
* Is used to retrieve options and manage options notifications for `TOptions` instances.
478-
* Is registered as a [singleton service](/dotnet/core/extensions/dependency-injection#singleton) and can be injected into any [service lifetime](/dotnet/core/extensions/dependency-injection#service-lifetimes).
478+
* Is registered as a [singleton service](/dotnet/core/extensions/dependency-injection/service-lifetimes#singleton) and can be injected into any [service lifetime](/dotnet/core/extensions/dependency-injection/service-lifetimes).
479479
* Supports:
480480
* Change notifications.
481481
* [Named options](#specify-a-custom-key-name-for-a-configuration-property-using-configurationkeyname).
@@ -491,13 +491,13 @@ For the preceding code, changes to the JSON configuration in the app settings fi
491491
Using <xref:Microsoft.Extensions.Options.IOptionsSnapshot%601>:
492492

493493
* Options are computed once per request when accessed and cached for the lifetime of the request.
494-
* May incur a significant performance penalty because it's a [scoped service](/dotnet/core/extensions/dependency-injection#scoped) and is recomputed per request. For more information, see [`IOptionsSnapshot` is very slow (`dotnet/runtime` #53793)](https://github.com/dotnet/runtime/issues/53793) and [Improve the performance of configuration binding (`dotnet/runtime` #36130)](https://github.com/dotnet/runtime/issues/36130).
494+
* May incur a significant performance penalty because it's a [scoped service](/dotnet/core/extensions/dependency-injection/service-lifetimes#scoped) and is recomputed per request. For more information, see [`IOptionsSnapshot` is very slow (`dotnet/runtime` #53793)](https://github.com/dotnet/runtime/issues/53793) and [Improve the performance of configuration binding (`dotnet/runtime` #36130)](https://github.com/dotnet/runtime/issues/36130).
495495
* Changes to the configuration are read after the app starts when using configuration providers that support reading updated configuration values.
496496

497497
The difference between [`IOptionsMonitor`](#use-ioptionsmonitor-to-read-updated-data) and <xref:Microsoft.Extensions.Options.IOptionsSnapshot%601> is that:
498498

499-
* <xref:Microsoft.Extensions.Options.IOptionsMonitor%601> is a [singleton service](/dotnet/core/extensions/dependency-injection#singleton) that retrieves current option values at any time, which is especially useful in singleton dependencies.
500-
* <xref:Microsoft.Extensions.Options.IOptionsSnapshot%601> is a [scoped service](/dotnet/core/extensions/dependency-injection#scoped) and provides a snapshot of the options at the time the `IOptionsSnapshot<T>` object is constructed. Options snapshots are designed for use with transient and scoped dependencies.
499+
* <xref:Microsoft.Extensions.Options.IOptionsMonitor%601> is a [singleton service](/dotnet/core/extensions/dependency-injection/service-lifetimes#singleton) that retrieves current option values at any time, which is especially useful in singleton dependencies.
500+
* <xref:Microsoft.Extensions.Options.IOptionsSnapshot%601> is a [scoped service](/dotnet/core/extensions/dependency-injection/service-lifetimes#scoped) and provides a snapshot of the options at the time the `IOptionsSnapshot<T>` object is constructed. Options snapshots are designed for use with transient and scoped dependencies.
501501

502502
The ASP.NET Core runtime uses <xref:Microsoft.Extensions.Options.OptionsCache%601> to cache the options instance after it's created.
503503

@@ -620,8 +620,8 @@ After the app has started, changes to the JSON configuration in the app settings
620620

621621
The difference between <xref:Microsoft.Extensions.Options.IOptionsMonitor%601> and [`IOptionsSnapshot`](#use-ioptionssnapshot-to-read-updated-data) is that:
622622

623-
* <xref:Microsoft.Extensions.Options.IOptionsMonitor%601> is a [singleton service](/dotnet/core/extensions/dependency-injection#singleton) that retrieves current option values at any time, which is especially useful in singleton dependencies.
624-
* <xref:Microsoft.Extensions.Options.IOptionsSnapshot%601> is a [scoped service](/dotnet/core/extensions/dependency-injection#scoped) and provides a snapshot of the options at the time the `IOptionsSnapshot<T>` object is constructed. Options snapshots are designed for use with transient and scoped dependencies.
623+
* <xref:Microsoft.Extensions.Options.IOptionsMonitor%601> is a [singleton service](/dotnet/core/extensions/dependency-injection/service-lifetimes#singleton) that retrieves current option values at any time, which is especially useful in singleton dependencies.
624+
* <xref:Microsoft.Extensions.Options.IOptionsSnapshot%601> is a [scoped service](/dotnet/core/extensions/dependency-injection/service-lifetimes#scoped) and provides a snapshot of the options at the time the `IOptionsSnapshot<T>` object is constructed. Options snapshots are designed for use with transient and scoped dependencies.
625625

626626
<xref:Microsoft.Extensions.Options.IOptionsMonitorCache%601> is used by <xref:Microsoft.Extensions.Options.IOptionsMonitor%601> to cache `TOptions` instances. <xref:Microsoft.Extensions.Options.IOptionsMonitorCache%601.TryRemove%2A?displayProperty=nameWithType> invalidates options instances in the monitor so that the value is recomputed. Values can be manually introduced with <xref:Microsoft.Extensions.Options.IOptionsMonitorCache%601.TryAdd%2A?displayProperty=nameWithType>. The <xref:Microsoft.Extensions.Options.IOptionsMonitorCache%601.Clear%2A> method is used when all named instances should be recreated on demand.
627627

aspnetcore/fundamentals/dependency-injection.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ The following code is generated by the Razor Pages template using individual acc
109109

110110
## Service lifetimes
111111

112-
See [Service lifetimes](/dotnet/core/extensions/dependency-injection#service-lifetimes) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
112+
See [Service lifetimes](/dotnet/core/extensions/dependency-injection/service-lifetimes) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
113113

114114
To use scoped services in middleware, use one of the following approaches:
115115

@@ -120,7 +120,7 @@ For more information, see <xref:fundamentals/middleware/write#per-request-middle
120120

121121
## Service registration methods
122122

123-
See [Service registration methods](/dotnet/core/extensions/dependency-injection#service-registration-methods) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
123+
See [Service registration](/dotnet/core/extensions/dependency-injection/service-registration) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
124124

125125
It's common to use multiple implementations when [mocking types for testing](xref:test/integration-tests#inject-mock-services).
126126

@@ -270,15 +270,15 @@ In the preceding code:
270270

271271
### IDisposable guidance for Transient and shared instances
272272

273-
See [IDisposable guidance for Transient and shared instance](/dotnet/core/extensions/dependency-injection-guidelines#idisposable-guidance-for-transient-and-shared-instances) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
273+
See [IDisposable guidance for Transient and shared instance](/dotnet/core/extensions/dependency-injection/guidelines#idisposable-guidance-for-transient-and-shared-instances) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
274274

275275
## Default service container replacement
276276

277-
See [Default service container replacement](/dotnet/core/extensions/dependency-injection-guidelines#default-service-container-replacement) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
277+
See [Default service container replacement](/dotnet/core/extensions/dependency-injection/guidelines#default-service-container-replacement) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
278278

279279
## Recommendations
280280

281-
See [Recommendations](/dotnet/core/extensions/dependency-injection-guidelines#recommendations) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
281+
See [Recommendations](/dotnet/core/extensions/dependency-injection/guidelines#recommendations) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
282282

283283
* Avoid using the *service locator pattern*. For example, don't invoke <xref:System.IServiceProvider.GetService%2A> to obtain a service instance when you can use DI instead:
284284

@@ -349,11 +349,11 @@ The following table lists a small sample of these framework-registered services:
349349
* [NDC Conference Patterns for DI app development](https://www.youtube.com/watch?v=x-C-CNBVTaY)
350350
* <xref:fundamentals/startup>
351351
* <xref:fundamentals/middleware/extensibility>
352-
* [Understand dependency injection basics in .NET](/dotnet/core/extensions/dependency-injection-basics)
353-
* [Dependency injection guidelines](/dotnet/core/extensions/dependency-injection-guidelines)
354-
* [Tutorial: Use dependency injection in .NET](/dotnet/core/extensions/dependency-injection-usage)
352+
* [Understand dependency injection basics in .NET](/dotnet/core/extensions/dependency-injection/basics)
353+
* [Dependency injection guidelines](/dotnet/core/extensions/dependency-injection/guidelines)
354+
* [Tutorial: Use dependency injection in .NET](/dotnet/core/extensions/dependency-injection/usage)
355355
* [.NET dependency injection](/dotnet/core/extensions/dependency-injection)
356-
* [ASP.NET CORE DEPENDENCY INJECTION: WHAT IS THE ISERVICECOLLECTION?](https://www.stevejgordon.co.uk/aspnet-core-dependency-injection-what-is-the-iservicecollection)
356+
* [ASP.NET Core Dependecy Injection: What is the IServiceCollection?](https://www.stevejgordon.co.uk/aspnet-core-dependency-injection-what-is-the-iservicecollection)
357357
* [Four ways to dispose IDisposables in ASP.NET Core](https://andrewlock.net/four-ways-to-dispose-idisposables-in-asp-net-core/)
358358
* [Writing Clean Code in ASP.NET Core with Dependency Injection (MSDN)](/archive/msdn-magazine/2016/may/asp-net-writing-clean-code-in-asp-net-core-with-dependency-injection)
359359
* [Explicit Dependencies Principle](/dotnet/standard/modern-web-apps-azure-architecture/architectural-principles#explicit-dependencies)

aspnetcore/fundamentals/dependency-injection/includes/dependency-injection-5-7.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The following code is generated by the Razor Pages template using individual use
9999

100100
## Service lifetimes
101101

102-
See [Service lifetimes](/dotnet/core/extensions/dependency-injection#service-lifetimes) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
102+
See [Service lifetimes](/dotnet/core/extensions/dependency-injection/service-lifetimes) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
103103

104104
To use scoped services in middleware, use one of the following approaches:
105105

@@ -246,15 +246,15 @@ In the preceding code:
246246

247247
### IDisposable guidance for Transient and shared instances
248248

249-
See [IDisposable guidance for Transient and shared instance](/dotnet/core/extensions/dependency-injection-guidelines#idisposable-guidance-for-transient-and-shared-instances) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
249+
See [IDisposable guidance for Transient and shared instance](/dotnet/core/extensions/dependency-injection/guidelines#idisposable-guidance-for-transient-and-shared-instances) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
250250

251251
## Default service container replacement
252252

253-
See [Default service container replacement](/dotnet/core/extensions/dependency-injection-guidelines#default-service-container-replacement) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
253+
See [Default service container replacement](/dotnet/core/extensions/dependency-injection/guidelines#default-service-container-replacement) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
254254

255255
## Recommendations
256256

257-
See [Recommendations](/dotnet/core/extensions/dependency-injection-guidelines#recommendations) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
257+
See [Recommendations](/dotnet/core/extensions/dependency-injection/guidelines#recommendations) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
258258

259259
* Avoid using the *service locator pattern*. For example, don't invoke <xref:System.IServiceProvider.GetService%2A> to obtain a service instance when you can use DI instead:
260260

@@ -489,7 +489,7 @@ The following code is generated by the Razor Pages template using individual use
489489

490490
## Service lifetimes
491491

492-
See [Service lifetimes](/dotnet/core/extensions/dependency-injection#service-lifetimes) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
492+
See [Service lifetimes](/dotnet/core/extensions/dependency-injection/service-lifetimes) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
493493

494494
To use scoped services in middleware, use one of the following approaches:
495495

@@ -640,15 +640,15 @@ In the preceding code:
640640

641641
### IDisposable guidance for Transient and shared instances
642642

643-
See [IDisposable guidance for Transient and shared instance](/dotnet/core/extensions/dependency-injection-guidelines#idisposable-guidance-for-transient-and-shared-instances) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
643+
See [IDisposable guidance for Transient and shared instance](/dotnet/core/extensions/dependency-injection/guidelines#idisposable-guidance-for-transient-and-shared-instances) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
644644

645645
## Default service container replacement
646646

647-
See [Default service container replacement](/dotnet/core/extensions/dependency-injection-guidelines#default-service-container-replacement) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
647+
See [Default service container replacement](/dotnet/core/extensions/dependency-injection/guidelines#default-service-container-replacement) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
648648

649649
## Recommendations
650650

651-
See [Recommendations](/dotnet/core/extensions/dependency-injection-guidelines#recommendations) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
651+
See [Recommendations](/dotnet/core/extensions/dependency-injection/guidelines#recommendations) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
652652

653653
* Avoid using the *service locator pattern*. For example, don't invoke <xref:System.IServiceProvider.GetService%2A> to obtain a service instance when you can use DI instead:
654654

aspnetcore/fundamentals/dependency-injection/includes/dependency-injection-8.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ The following code is generated by the Razor Pages template using individual acc
100100

101101
## Service lifetimes
102102

103-
See [Service lifetimes](/dotnet/core/extensions/dependency-injection#service-lifetimes) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
103+
See [Service lifetimes](/dotnet/core/extensions/dependency-injection/service-lifetimes) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
104104

105105
To use scoped services in middleware, use one of the following approaches:
106106

@@ -252,15 +252,15 @@ In the preceding code:
252252

253253
### IDisposable guidance for Transient and shared instances
254254

255-
See [IDisposable guidance for Transient and shared instance](/dotnet/core/extensions/dependency-injection-guidelines#idisposable-guidance-for-transient-and-shared-instances) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
255+
See [IDisposable guidance for Transient and shared instance](/dotnet/core/extensions/dependency-injection/guidelines#idisposable-guidance-for-transient-and-shared-instances) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
256256

257257
## Default service container replacement
258258

259-
See [Default service container replacement](/dotnet/core/extensions/dependency-injection-guidelines#default-service-container-replacement) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
259+
See [Default service container replacement](/dotnet/core/extensions/dependency-injection/guidelines#default-service-container-replacement) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
260260

261261
## Recommendations
262262

263-
See [Recommendations](/dotnet/core/extensions/dependency-injection-guidelines#recommendations) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
263+
See [Recommendations](/dotnet/core/extensions/dependency-injection/guidelines#recommendations) in [Dependency injection in .NET](/dotnet/core/extensions/dependency-injection)
264264

265265
* Avoid using the *service locator pattern*. For example, don't invoke <xref:System.IServiceProvider.GetService%2A> to obtain a service instance when you can use DI instead:
266266

@@ -352,9 +352,9 @@ The following table lists a small sample of these framework-registered services:
352352
* [NDC Conference Patterns for DI app development](https://www.youtube.com/watch?v=x-C-CNBVTaY)
353353
* <xref:fundamentals/startup>
354354
* <xref:fundamentals/middleware/extensibility>
355-
* [Understand dependency injection basics in .NET](/dotnet/core/extensions/dependency-injection-basics)
356-
* [Dependency injection guidelines](/dotnet/core/extensions/dependency-injection-guidelines)
357-
* [Tutorial: Use dependency injection in .NET](/dotnet/core/extensions/dependency-injection-usage)
355+
* [Understand dependency injection basics in .NET](/dotnet/core/extensions/dependency-injection/basics)
356+
* [Dependency injection guidelines](/dotnet/core/extensions/dependency-injection/guidelines)
357+
* [Tutorial: Use dependency injection in .NET](/dotnet/core/extensions/dependency-injection/usage)
358358
* [.NET dependency injection](/dotnet/core/extensions/dependency-injection)
359359
* [ASP.NET CORE DEPENDENCY INJECTION: WHAT IS THE ISERVICECOLLECTION?](https://www.stevejgordon.co.uk/aspnet-core-dependency-injection-what-is-the-iservicecollection)
360360
* [Four ways to dispose IDisposables in ASP.NET Core](https://andrewlock.net/four-ways-to-dispose-idisposables-in-asp-net-core/)

0 commit comments

Comments
 (0)