Skip to content

Commit 593ba4f

Browse files
authored
[10.0] API doc cross-links (#36336)
1 parent 1daf39e commit 593ba4f

File tree

12 files changed

+82
-139
lines changed

12 files changed

+82
-139
lines changed

aspnetcore/blazor/call-web-api.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -851,9 +851,7 @@ To simplify the creation of PATCH documents in the app issuing PATCH requests, a
851851
852852
:::moniker range=">= aspnetcore-10.0"
853853
854-
<!-- UPDATE 10.0 - API doc cross-link -->
855-
856-
Install the [`Microsoft.AspNetCore.JsonPatch.SystemTextJson`](https://www.nuget.org/packages/Microsoft.AspNetCore.JsonPatch.SystemTextJson) NuGet package and use the API features of the package to compose a `JsonPatchDocument` for a PATCH request.
854+
Install the [`Microsoft.AspNetCore.JsonPatch.SystemTextJson`](https://www.nuget.org/packages/Microsoft.AspNetCore.JsonPatch.SystemTextJson) NuGet package and use the API features of the package to compose a <xref:Microsoft.AspNetCore.JsonPatch.JsonPatchDocument> for a PATCH request.
857855
858856
[!INCLUDE[](~/includes/package-reference.md)]
859857
@@ -924,11 +922,9 @@ Follow the guidance in the <xref:web-api/jsonpatch> article to add a PATCH contr
924922
925923
:::moniker range=">= aspnetcore-10.0"
926924
927-
<!-- UPDATE 10.0 - API doc cross-link -->
928-
929-
Add a package reference for the [`Microsoft.AspNetCore.JsonPatch.SystemTextJson`](https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.NewtonsoftJson) NuGet package to the web API app.
925+
Add a package reference for the [`Microsoft.AspNetCore.JsonPatch.SystemTextJson`](https://www.nuget.org/packages/Microsoft.AspNetCore.JsonPatch.SystemTextJson) NuGet package to the web API app.
930926
931-
In the `Program` file add an `@using` directive for the `Microsoft.AspNetCore.JsonPatch.SystemTextJson` <!-- <xref:Microsoft.AspNetCore.JsonPatch.SystemTextJson?displayProperty=fullName> --> namespace:
927+
In the `Program` file add an `@using` directive for the <xref:Microsoft.AspNetCore.JsonPatch.SystemTextJson?displayProperty=fullName> namespace:
932928
933929
```csharp
934930
using Microsoft.AspNetCore.JsonPatch.SystemTextJson;

aspnetcore/blazor/components/integration.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,7 @@ In `Pages/_Host.cshtml` of Blazor apps that are `ServerPrerendered` in a Blazor
406406

407407
:::moniker range=">= aspnetcore-10.0"
408408

409-
<!-- UPDATE 10.0 - API cross-link -->
410-
411-
Decide what state to persist using the <xref:Microsoft.AspNetCore.Components.PersistentComponentState> service. The `[PersistentState]` attribute applied to a property registers a callback to persist the state during prerendering and loads it when the component renders interactively or the service is instantiated.
409+
Decide what state to persist using the <xref:Microsoft.AspNetCore.Components.PersistentComponentState> service. The [`[PersistentState]` attribute](xref:Microsoft.AspNetCore.Components.PersistentStateAttribute) applied to a property registers a callback to persist the state during prerendering and loads it when the component renders interactively or the service is instantiated.
412410

413411
In the following example, the `{TYPE}` placeholder represents the type of data to persist (for example, `WeatherForecast[]`).
414412

aspnetcore/blazor/components/quickgrid.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,7 @@ QuickGrid also supports passing custom attributes and style classes (<xref:Micro
195195

196196
## Style a table row based on the row item
197197

198-
<!-- UPDATE 10.0 API cross-link -->
199-
200-
Apply a stylesheet class to a row of the grid based on the row item using the `RowClass` parameter.
198+
Apply a stylesheet class to a row of the grid based on the row item using the <xref:Microsoft.AspNetCore.Components.QuickGrid.QuickGrid%601.RowClass%2A> parameter.
201199

202200
In the following example:
203201

@@ -219,16 +217,11 @@ In the following example:
219217

220218
:::moniker-end
221219

222-
223220
:::moniker range=">= aspnetcore-10.0"
224221

225-
<!-- UPDATE 10.0 - API cross-link -->
226-
227-
:::moniker-end
228-
229222
### Close `QuickGrid` column options
230223

231-
Close the `QuickGrid` column options UI with the `HideColumnOptionsAsync` method.
224+
Close the `QuickGrid` column options UI with the <xref:Microsoft.AspNetCore.Components.QuickGrid.QuickGrid%601.HideColumnOptionsAsync%2A> method.
232225

233226
The following example closes the column options UI as soon as the title filter is applied:
234227

@@ -253,6 +246,8 @@ The following example closes the column options UI as soon as the title filter i
253246
}
254247
```
255248

249+
:::moniker-end
250+
256251
## Entity Framework Core (EF Core) data source
257252

258253
Use the factory pattern to resolve an EF Core database context that provides data to a `QuickGrid` component. For more information on why the factory pattern is recommended, see <xref:blazor/blazor-ef-core>.

aspnetcore/blazor/forms/input-components.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ The validation summary displays the friendly name when the field's value is inva
458458

459459
> The Production Date field must be a date.
460460
461-
<!-- UPDATE 10.0 The feature has been backlogged.
461+
<!-- UPDATE 11.0 The feature has been backlogged.
462462
https://github.com/dotnet/aspnetcore/issues/49147
463463
464464
> [!NOTE]
@@ -561,9 +561,7 @@ Assign a custom template to <xref:Microsoft.AspNetCore.Components.Forms.InputDat
561561

562562
## `InputHidden` component to handle hidden input fields in forms
563563

564-
<!-- UPDATE 10.0 - API doc cross-link -->
565-
566-
The `InputHidden` component provides a hidden input field for storing string values.
564+
The [`InputHidden` component](xref:Microsoft.AspNetCore.Components.Forms.InputHidden) provides a hidden input field for storing string values.
567565

568566
In the following example, a hidden input field is created for the form's `Parameter` property. When the form is submitted, the value of the hidden field is displayed:
569567

aspnetcore/blazor/forms/validation.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,16 +1574,17 @@ The <xref:System.ComponentModel.DataAnnotations.CompareAttribute> doesn't work w
15741574

15751575
## Use validation models from a different assembly
15761576

1577-
<!-- UPDATE 10.0 - API cross-links -->
1578-
15791577
For model validation defined in a different assembly, such as a library or the `.Client` project of a Blazor Web App:
15801578

15811579
* If the library is a plain class library (it isn't based on the `Microsoft.NET.Sdk.Web` or `Microsoft.NET.Sdk.Razor` SDKs), add a package reference to the library for the [`Microsoft.Extensions.Validation` NuGet package](https://www.nuget.org/packages/Microsoft.Extensions.Validation).
1582-
* Create a method in the library or `.Client` project that receives an <xref:Microsoft.Extensions.DependencyInjection.IServiceCollection> instance as an argument and calls `AddValidation` on it.
1583-
* In the app, call both the method and `AddValidation`.
1580+
* Create a method in the library or `.Client` project that receives an <xref:Microsoft.Extensions.DependencyInjection.IServiceCollection> instance as an argument and calls <xref:Microsoft.Extensions.DependencyInjection.ValidationServiceCollectionExtensions.AddValidation%2A> on it.
1581+
* In the app, call both the method and <xref:Microsoft.Extensions.DependencyInjection.ValidationServiceCollectionExtensions.AddValidation%2A>.
15841582

15851583
The preceding approach results in validation of the types from both assemblies.
15861584

1585+
<!-- UPDATE 10.0 - MIA API
1586+
`AddValidationForTypesInClient` -->
1587+
15871588
In the following example, the `AddValidationForTypesInClient` method is created for the `.Client` project of a Blazor Web App for validation using types defined in the `.Client` project.
15881589

15891590
`ServiceCollectionExtensions.cs` (in the `.Client` project):
@@ -1601,7 +1602,7 @@ public static class ServiceCollectionExtensions
16011602
}
16021603
```
16031604

1604-
In the server project's `Program` file, add the namespace and call the `.Client` project's service collection extension method (`AddValidationForTypesInClient`) and `AddValidation`:
1605+
In the server project's `Program` file, add the namespace and call the `.Client` project's service collection extension method (`AddValidationForTypesInClient`) and <xref:Microsoft.Extensions.DependencyInjection.ValidationServiceCollectionExtensions.AddValidation%2A>:
16051606

16061607
```csharp
16071608
using BlazorSample.Client.Extensions;
@@ -1624,19 +1625,17 @@ To create a validated form, use a <xref:Microsoft.AspNetCore.Components.Forms.Da
16241625

16251626
To opt into the nested objects and collection types validation feature:
16261627

1627-
<!-- UPDATE 10.0 - API cross-links -->
1628-
1629-
1. Call the `AddValidation` extension method in the `Program` file where services are registered.
1628+
1. Call the <xref:Microsoft.Extensions.DependencyInjection.ValidationServiceCollectionExtensions.AddValidation%2A> extension method in the `Program` file where services are registered.
16301629
2. Declare the form model types in a C# class file, not in a Razor component (`.razor`).
1631-
3. Annotate the root form model type with the `[ValidatableType]` attribute.
1630+
3. Annotate the root form model type with the [`[ValidatableType]` attribute](xref:Microsoft.Extensions.Validation.ValidatableTypeAttribute).
16321631

16331632
Without following the preceding steps, form validation behavior doesn't include nested model and collection type validation.
16341633

16351634
<!-- UPDATE 10.0 - Replace with a fully working, cut-'n-paste example -->
16361635

16371636
The following example demonstrates customer orders with the improved form validation (details omitted for brevity):
16381637

1639-
In `Program.cs`, call `AddValidation` on the service collection:
1638+
In `Program.cs`, call <xref:Microsoft.Extensions.DependencyInjection.ValidationServiceCollectionExtensions.AddValidation%2A> on the service collection:
16401639

16411640
```csharp
16421641
builder.Services.AddValidation();

aspnetcore/blazor/javascript-interoperability/call-javascript-from-dotnet.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -461,14 +461,13 @@ IJSRuntime JS { get; set; }
461461

462462
:::moniker range=">= aspnetcore-10.0"
463463

464-
<!-- UPDATE 10.0 - API Browser cross-links in the next
465-
two H2 sections. -->
464+
<!-- UPDATE 10.0 - MIA API -->
466465

467466
## Create an instance of a JS object using a constructor function
468467

469468
Create an instance of a JS object using a constructor function and get the <xref:Microsoft.JSInterop.IJSObjectReference>/<xref:Microsoft.JSInterop.IJSInProcessObjectReference> .NET handle for referencing the instance with the following API:
470469

471-
* `InvokeConstructorAsync` (asynchronous)
470+
* <xref:Microsoft.JSInterop.JSRuntime.InvokeConstructorAsync%2A> (asynchronous)
472471
* `InvokeConstructor` (synchronous)
473472

474473
Examples in this section demonstrate the API calls with the following `TestClass` with a constructor function (`constructor(text)`):
@@ -487,7 +486,7 @@ window.TestClass = class {
487486

488487
### Asynchronous `InvokeConstructorAsync`
489488

490-
Use `InvokeConstructorAsync(string identifier, object?[]? args)` on <xref:Microsoft.JSInterop.IJSRuntime> and <xref:Microsoft.JSInterop.IJSObjectReference> to invoke the specified JS constructor function asynchronously. The function is invoked with the `new` operator. In the following example, `TestClass` contains a constructor function, and `classRef` is an <xref:Microsoft.JSInterop.IJSObjectReference>.
489+
Use <xref:Microsoft.JSInterop.JSRuntime.InvokeConstructorAsync%2A> on <xref:Microsoft.JSInterop.IJSRuntime> and <xref:Microsoft.JSInterop.IJSObjectReference> to invoke the specified JS constructor function asynchronously. The function is invoked with the `new` operator. In the following example, `TestClass` contains a constructor function, and `classRef` is an <xref:Microsoft.JSInterop.IJSObjectReference>.
491490

492491
```csharp
493492
var classRef = await JSRuntime.InvokeConstructorAsync("TestClass", "Blazor!");
@@ -499,7 +498,7 @@ An overload is available that takes a <xref:System.Threading.CancellationToken>
499498

500499
### Synchronous `InvokeConstructor`
501500

502-
Use `InvokeConstructor(string identifier, object?[]? args)` on <xref:Microsoft.JSInterop.IJSInProcessRuntime> and <xref:Microsoft.JSInterop.IJSInProcessObjectReference> to invoke the specified JS constructor function synchronously. The function is invoked with the `new` operator. In the following example, `TestClass` contains a constructor function, and `classRef` is an <xref:Microsoft.JSInterop.IJSInProcessObjectReference>:
501+
Use `InvokeConstructor` on <xref:Microsoft.JSInterop.IJSInProcessRuntime> and <xref:Microsoft.JSInterop.IJSInProcessObjectReference> to invoke the specified JS constructor function synchronously. The function is invoked with the `new` operator. In the following example, `TestClass` contains a constructor function, and `classRef` is an <xref:Microsoft.JSInterop.IJSInProcessObjectReference>:
503502

504503
```csharp
505504
var inProcRuntime = ((IJSInProcessRuntime)JSRuntime);
@@ -514,7 +513,7 @@ An overload is available that takes a <xref:System.Threading.CancellationToken>
514513

515514
Read or modify the value of a JS object property, both data and accessor properties, with the following API:
516515

517-
* `GetValueAsync`/`SetValueAsync` (asynchronous)
516+
* <xref:Microsoft.JSInterop.JSRuntime.GetValueAsync%2A>/<xref:Microsoft.JSInterop.JSRuntime.SetValueAsync%2A> (asynchronous)
518517
* `GetValue`/`SetValue` (synchronous)
519518

520519
Examples in this section demonstrate the API calls with the following JS object (`testObject`):
@@ -527,14 +526,14 @@ window.testObject = {
527526

528527
### Asynchronous `GetValueAsync` and `SetValueAsync`
529528

530-
Use `GetValueAsync<TValue>(string identifier)` to read the value of the specified JS property asynchronously. A <xref:Microsoft.JSInterop.JSException> is thrown if the property doesn't exist or is a `set`-only property. In the following example, the value of `testObject.num` (10) is stored in `valueFromDataPropertyAsync`:
529+
Use <xref:Microsoft.JSInterop.JSRuntime.GetValueAsync%2A> to read the value of the specified JS property asynchronously. A <xref:Microsoft.JSInterop.JSException> is thrown if the property doesn't exist or is a `set`-only property. In the following example, the value of `testObject.num` (10) is stored in `valueFromDataPropertyAsync`:
531530

532531
```csharp
533532
var valueFromDataPropertyAsync =
534533
await JSRuntime.GetValueAsync<int>("testObject.num");
535534
```
536535

537-
Use `SetValueAsync<TValue>(string identifier, TValue value)` to update the value of the specified JS property asynchronously. If the property isn't defined on the target object, the property is created. A <xref:Microsoft.JSInterop.JSException> is thrown if the property exists but isn't writable or when a new property can't be added to the object. In the following example, `testObject.num` is set to 20, and `num2` is created with a value of 30 on `testObject`:
536+
Use <xref:Microsoft.JSInterop.JSRuntime.SetValueAsync%2A> to update the value of the specified JS property asynchronously. If the property isn't defined on the target object, the property is created. A <xref:Microsoft.JSInterop.JSException> is thrown if the property exists but isn't writable or when a new property can't be added to the object. In the following example, `testObject.num` is set to 20, and `num2` is created with a value of 30 on `testObject`:
538537

539538
```csharp
540539
await JSRuntime.SetValueAsync("testObject.num", 20);
@@ -543,14 +542,14 @@ await JSRuntime.SetValueAsync("testObject.num2", 30);
543542

544543
### Synchronous `GetValue` and `SetValue`
545544

546-
Use `GetValue<TValue>(string identifier)` to read the value of the specified JS property synchronously. A <xref:Microsoft.JSInterop.JSException> is thrown if the property doesn't exist or is a `set`-only property. In the following example, the value of `testObject.num` (10) is stored in `valueFromDataProperty`:
545+
Use `GetValue` to read the value of the specified JS property synchronously. A <xref:Microsoft.JSInterop.JSException> is thrown if the property doesn't exist or is a `set`-only property. In the following example, the value of `testObject.num` (10) is stored in `valueFromDataProperty`:
547546

548547
```csharp
549548
var inProcRuntime = ((IJSInProcessRuntime)JSRuntime);
550549
var valueFromDataProperty = inProcRuntime.GetValue<int>("testObject.num");
551550
```
552551

553-
Use `SetValue<TValue>(string identifier, TValue value)` to update the value of the specified JS property synchronously. The property can't be a `get`-only property. If the property isn't defined on the target object, the property is created. A <xref:Microsoft.JSInterop.JSException> is thrown if the property exists but isn't writable or when a new property can't be added to the object. In the following example, `testObject.num` is set to 20, and `num2` is created with a value of 30 on `testObject`:
552+
Use `SetValue` to update the value of the specified JS property synchronously. The property can't be a `get`-only property. If the property isn't defined on the target object, the property is created. A <xref:Microsoft.JSInterop.JSException> is thrown if the property exists but isn't writable or when a new property can't be added to the object. In the following example, `testObject.num` is set to 20, and `num2` is created with a value of 30 on `testObject`:
554553

555554
```csharp
556555
var inProcRuntime = ((IJSInProcessRuntime)JSRuntime);
@@ -630,16 +629,16 @@ In server-side scenarios, JS interop calls can't be issued after Blazor's Signal
630629

631630
:::moniker range=">= aspnetcore-10.0"
632631

633-
<!-- UPDATE 10.0 - API Browser cross-links -->
632+
<!-- UPDATE 10.0 - MIA API -->
634633

635634
* JS interop method calls
636635
* <xref:Microsoft.JSInterop.IJSRuntime.InvokeAsync%2A?displayProperty=nameWithType>
637636
* <xref:Microsoft.JSInterop.JSRuntimeExtensions.InvokeAsync%2A?displayProperty=nameWithType>
638637
* <xref:Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync%2A?displayProperty=nameWithType>
639-
* `InvokeConstructorAsync`
640-
* `GetValueAsync`
641-
* `SetValueAsync`
642-
* `Dispose`/`DisposeAsync` calls on any <xref:Microsoft.JSInterop.IJSObjectReference>.
638+
* <xref:Microsoft.JSInterop.JSRuntime.InvokeConstructorAsync%2A>
639+
* <xref:Microsoft.JSInterop.JSRuntime.GetValueAsync%2A>
640+
* <xref:Microsoft.JSInterop.JSRuntime.SetValueAsync%2A>
641+
* <xref:Microsoft.JSInterop.JSRuntime.Dispose%2A>/`DisposeAsync` calls on any <xref:Microsoft.JSInterop.IJSObjectReference>.
643642

644643
:::moniker-end
645644

@@ -649,7 +648,7 @@ In server-side scenarios, JS interop calls can't be issued after Blazor's Signal
649648
* <xref:Microsoft.JSInterop.IJSRuntime.InvokeAsync%2A?displayProperty=nameWithType>
650649
* <xref:Microsoft.JSInterop.JSRuntimeExtensions.InvokeAsync%2A?displayProperty=nameWithType>
651650
* <xref:Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync%2A?displayProperty=nameWithType>
652-
* `Dispose`/`DisposeAsync` calls on any <xref:Microsoft.JSInterop.IJSObjectReference>.
651+
* <xref:Microsoft.JSInterop.JSRuntime.Dispose%2A>/`DisposeAsync` calls on any <xref:Microsoft.JSInterop.IJSObjectReference>.
653652

654653
:::moniker-end
655654

aspnetcore/blazor/javascript-interoperability/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,15 +331,15 @@ JavaScript (JS) interop calls can't be issued after Blazor's SignalR circuit is
331331

332332
:::moniker range=">= aspnetcore-10.0"
333333

334-
<!-- UPDATE 10.0 - API Browser cross-links -->
334+
<!-- UPDATE 10.0 - MIA API -->
335335

336336
* JS interop method calls
337337
* <xref:Microsoft.JSInterop.IJSRuntime.InvokeAsync%2A?displayProperty=nameWithType>
338338
* <xref:Microsoft.JSInterop.JSRuntimeExtensions.InvokeAsync%2A?displayProperty=nameWithType>
339339
* <xref:Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync%2A?displayProperty=nameWithType>
340-
* `InvokeConstructorAsync`
341-
* `GetValueAsync`
342-
* `SetValueAsync`
340+
* <xref:Microsoft.JSInterop.IJSObjectReference.InvokeConstructorAsync%2A>
341+
* <xref:Microsoft.JSInterop.IJSObjectReference.GetValueAsync%2A>
342+
* <xref:Microsoft.JSInterop.IJSObjectReference.SetValueAsync%2A>
343343
* `Dispose`/`DisposeAsync` calls on any <xref:Microsoft.JSInterop.IJSObjectReference>.
344344

345345
:::moniker-end

0 commit comments

Comments
 (0)