You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/blazor/call-web-api.md
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -851,9 +851,7 @@ To simplify the creation of PATCH documents in the app issuing PATCH requests, a
851
851
852
852
:::monikerrange=">= aspnetcore-10.0"
853
853
854
-
<!--UPDATE10.0-APIdoccross-link-->
855
-
856
-
Installthe [`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
+
Installthe [`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.
857
855
858
856
[!INCLUDE[](~/includes/package-reference.md)]
859
857
@@ -924,11 +922,9 @@ Follow the guidance in the <xref:web-api/jsonpatch> article to add a PATCH contr
924
922
925
923
:::monikerrange=">= aspnetcore-10.0"
926
924
927
-
<!--UPDATE10.0-APIdoccross-link-->
928
-
929
-
Addapackagereferenceforthe [`Microsoft.AspNetCore.JsonPatch.SystemTextJson`](https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.NewtonsoftJson) NuGet package to the web API app.
925
+
Addapackagereferenceforthe [`Microsoft.AspNetCore.JsonPatch.SystemTextJson`](https://www.nuget.org/packages/Microsoft.AspNetCore.JsonPatch.SystemTextJson) NuGet package to the web API app.
Copy file name to clipboardExpand all lines: aspnetcore/blazor/components/integration.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -406,9 +406,7 @@ In `Pages/_Host.cshtml` of Blazor apps that are `ServerPrerendered` in a Blazor
406
406
407
407
:::moniker range=">= aspnetcore-10.0"
408
408
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.
412
410
413
411
In the following example, the `{TYPE}` placeholder represents the type of data to persist (for example, `WeatherForecast[]`).
Copy file name to clipboardExpand all lines: aspnetcore/blazor/components/quickgrid.md
+4-9Lines changed: 4 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -195,9 +195,7 @@ QuickGrid also supports passing custom attributes and style classes (<xref:Micro
195
195
196
196
## Style a table row based on the row item
197
197
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.
201
199
202
200
In the following example:
203
201
@@ -219,16 +217,11 @@ In the following example:
219
217
220
218
:::moniker-end
221
219
222
-
223
220
:::moniker range=">= aspnetcore-10.0"
224
221
225
-
<!-- UPDATE 10.0 - API cross-link -->
226
-
227
-
:::moniker-end
228
-
229
222
### Close `QuickGrid` column options
230
223
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.
232
225
233
226
The following example closes the column options UI as soon as the title filter is applied:
234
227
@@ -253,6 +246,8 @@ The following example closes the column options UI as soon as the title filter i
253
246
}
254
247
```
255
248
249
+
:::moniker-end
250
+
256
251
## Entity Framework Core (EF Core) data source
257
252
258
253
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>.
Copy file name to clipboardExpand all lines: aspnetcore/blazor/forms/input-components.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -458,7 +458,7 @@ The validation summary displays the friendly name when the field's value is inva
458
458
459
459
> The Production Date field must be a date.
460
460
461
-
<!-- UPDATE 10.0 The feature has been backlogged.
461
+
<!-- UPDATE 11.0 The feature has been backlogged.
462
462
https://github.com/dotnet/aspnetcore/issues/49147
463
463
464
464
> [!NOTE]
@@ -561,9 +561,7 @@ Assign a custom template to <xref:Microsoft.AspNetCore.Components.Forms.InputDat
561
561
562
562
## `InputHidden` component to handle hidden input fields in forms
563
563
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.
567
565
568
566
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:
Copy file name to clipboardExpand all lines: aspnetcore/blazor/forms/validation.md
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1574,16 +1574,17 @@ The <xref:System.ComponentModel.DataAnnotations.CompareAttribute> doesn't work w
1574
1574
1575
1575
## Use validation models from a different assembly
1576
1576
1577
-
<!-- UPDATE 10.0 - API cross-links -->
1578
-
1579
1577
For model validation defined in a different assembly, such as a library or the `.Client` project of a Blazor Web App:
1580
1578
1581
1579
* 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>.
1584
1582
1585
1583
The preceding approach results in validation of the types from both assemblies.
1586
1584
1585
+
<!-- UPDATE 10.0 - MIA API
1586
+
`AddValidationForTypesInClient` -->
1587
+
1587
1588
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.
1588
1589
1589
1590
`ServiceCollectionExtensions.cs` (in the `.Client` project):
@@ -1601,7 +1602,7 @@ public static class ServiceCollectionExtensions
1601
1602
}
1602
1603
```
1603
1604
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>:
1605
1606
1606
1607
```csharp
1607
1608
usingBlazorSample.Client.Extensions;
@@ -1624,19 +1625,17 @@ To create a validated form, use a <xref:Microsoft.AspNetCore.Components.Forms.Da
1624
1625
1625
1626
To opt into the nested objects and collection types validation feature:
1626
1627
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.
1630
1629
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).
1632
1631
1633
1632
Without following the preceding steps, form validation behavior doesn't include nested model and collection type validation.
1634
1633
1635
1634
<!-- UPDATE 10.0 - Replace with a fully working, cut-'n-paste example -->
1636
1635
1637
1636
The following example demonstrates customer orders with the improved form validation (details omitted for brevity):
1638
1637
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:
Copy file name to clipboardExpand all lines: aspnetcore/blazor/javascript-interoperability/call-javascript-from-dotnet.md
+15-16Lines changed: 15 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -461,14 +461,13 @@ IJSRuntime JS { get; set; }
461
461
462
462
:::moniker range=">= aspnetcore-10.0"
463
463
464
-
<!-- UPDATE 10.0 - API Browser cross-links in the next
465
-
two H2 sections. -->
464
+
<!-- UPDATE 10.0 - MIA API -->
466
465
467
466
## Create an instance of a JS object using a constructor function
468
467
469
468
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:
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 {
487
486
488
487
### Asynchronous `InvokeConstructorAsync`
489
488
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>.
@@ -499,7 +498,7 @@ An overload is available that takes a <xref:System.Threading.CancellationToken>
499
498
500
499
### Synchronous `InvokeConstructor`
501
500
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>:
Examples in this section demonstrate the API calls with the following JS object (`testObject`):
@@ -527,14 +526,14 @@ window.testObject = {
527
526
528
527
### Asynchronous `GetValueAsync` and `SetValueAsync`
529
528
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`:
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`:
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`:
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`:
0 commit comments