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
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -532,7 +532,7 @@ You can address this by flowing prerendered state using the Persistent Component
532
532
533
533
## JSON helpers
534
534
535
-
The [`System.Net.Http.Json`](https://www.nuget.org/packages/System.Net.Http.Json) package provides extension methods for <xref:System.Net.Http.HttpClient?displayProperty=fullName> and <xref:System.Net.Http.HttpContent?displayProperty=fullName> that perform automatic serialization and deserialization using [`System.Text.Json`](https://www.nuget.org/packages/System.Text.Json). The `System.Net.Http.Json` package is provided by the .NET shared framework and doesn't require adding a package reference to the app.
535
+
The [`System.Net.Http.Json` package](https://www.nuget.org/packages/System.Net.Http.Json) provides extension methods for <xref:System.Net.Http.HttpClient?displayProperty=fullName> and <xref:System.Net.Http.HttpContent?displayProperty=fullName> that perform automatic serialization and deserialization using [`System.Text.Json`](https://www.nuget.org/packages/System.Text.Json). The `System.Net.Http.Json` package is provided by the .NET shared framework and doesn't require adding a package reference to the app.
536
536
537
537
<xref:System.Net.Http.HttpClient> is available as a preconfigured service for making requests back to the origin server. <xref:System.Net.Http.HttpClient> and JSON helpers (<xref:System.Net.Http.Json.HttpClientJsonExtensions?displayProperty=nameWithType>) are also used to call third-party web API endpoints. <xref:System.Net.Http.HttpClient> is implemented using the browser's [Fetch API](https://developer.mozilla.org/docs/Web/API/Fetch_API) and is subject to its limitations, including enforcement of the same-origin policy, which is discussed later in this article in the *Cross-Origin Resource Sharing (CORS)* section.
538
538
@@ -750,7 +750,7 @@ using Microsoft.AspNetCore.JsonPatch.SystemTextJson;
750
750
Add a package reference for the [`Microsoft.AspNetCore.Mvc.NewtonsoftJson`](https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.NewtonsoftJson) NuGet package to the web API app.
751
751
752
752
> [!NOTE]
753
-
> There's no need to add a package reference for the [`Microsoft.AspNetCore.JsonPatch`](https://www.nuget.org/packages/Microsoft.AspNetCore.JsonPatch) package to the app because the reference to the `Microsoft.AspNetCore.Mvc.NewtonsoftJson` package automatically transitively adds a package reference for `Microsoft.AspNetCore.JsonPatch`.
753
+
> There's no need to add a package reference for the [`Microsoft.AspNetCore.JsonPatch` package](https://www.nuget.org/packages/Microsoft.AspNetCore.JsonPatch) to the app because the reference to the `Microsoft.AspNetCore.Mvc.NewtonsoftJson` package automatically transitively adds a package reference for `Microsoft.AspNetCore.JsonPatch`.
754
754
755
755
In the `Program` file add an `@using` directive for the <xref:Microsoft.AspNetCore.JsonPatch?displayProperty=fullName> namespace:
Copy file name to clipboardExpand all lines: aspnetcore/blazor/components/quickgrid.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ The [`QuickGrid` component](xref:Microsoft.AspNetCore.Components.QuickGrid) is a
16
16
17
17
## Package
18
18
19
-
Add a package reference for the [`Microsoft.AspNetCore.Components.QuickGrid`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.QuickGrid) package.
19
+
Add a package reference for the [`Microsoft.AspNetCore.Components.QuickGrid` package](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.QuickGrid).
Copy file name to clipboardExpand all lines: aspnetcore/blazor/forms/validation.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -389,7 +389,7 @@ The following example is based on:
389
389
* The `Starship` model (`Starship.cs`) of the [Example form](xref:blazor/forms/input-components#example-form) section of the *Input components* article.
390
390
* The `CustomValidation` component shown in the [Validator components](#validator-components) section.
391
391
392
-
Place the `Starship` model (`Starship.cs`) into a shared class library project so that both the client and server projects can use the model. Add or update the namespace to match the namespace of the shared app (for example, `namespace BlazorSample.Shared`). Since the model requires data annotations, confirm that the shared class library uses the shared framework or add the [`System.ComponentModel.Annotations`](https://www.nuget.org/packages/System.ComponentModel.Annotations) package to the shared project.
392
+
Place the `Starship` model (`Starship.cs`) into a shared class library project so that both the client and server projects can use the model. Add or update the namespace to match the namespace of the shared app (for example, `namespace BlazorSample.Shared`). Since the model requires data annotations, confirm that the shared class library uses the shared framework or add the [`System.ComponentModel.Annotations` package](https://www.nuget.org/packages/System.ComponentModel.Annotations) to the shared project.
393
393
394
394
[!INCLUDE[](~/includes/package-reference.md)]
395
395
@@ -403,7 +403,7 @@ In the main project of the Blazor Web App, add a controller to process starship
403
403
* The `Starship` model (`Starship.cs`) of the [Example form](xref:blazor/forms/input-components#example-form) section of the *Input components* article.
404
404
* The `CustomValidation` component shown in the [Validator components](#validator-components) section.
405
405
406
-
Place the `Starship` model (`Starship.cs`) into the solution's **`Shared`** project so that both the client and server apps can use the model. Add or update the namespace to match the namespace of the shared app (for example, `namespace BlazorSample.Shared`). Since the model requires data annotations, add the [`System.ComponentModel.Annotations`](https://www.nuget.org/packages/System.ComponentModel.Annotations) package to the **`Shared`** project.
406
+
Place the `Starship` model (`Starship.cs`) into the solution's **`Shared`** project so that both the client and server apps can use the model. Add or update the namespace to match the namespace of the shared app (for example, `namespace BlazorSample.Shared`). Since the model requires data annotations, add the [`System.ComponentModel.Annotations` package](https://www.nuget.org/packages/System.ComponentModel.Annotations) to the **`Shared`** project.
Copy file name to clipboardExpand all lines: aspnetcore/blazor/fundamentals/logging.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -254,7 +254,7 @@ After ***either*** of the preceding filters is added to the app, the console out
254
254
255
255
The example in this section demonstrates a custom logger provider for further customization.
256
256
257
-
Add a package reference to the app for the [`Microsoft.Extensions.Logging.Configuration`](https://www.nuget.org/packages/Microsoft.Extensions.Logging.Configuration) package.
257
+
Add a package reference to the app for the [`Microsoft.Extensions.Logging.Configuration` package](https://www.nuget.org/packages/Microsoft.Extensions.Logging.Configuration).
Copy file name to clipboardExpand all lines: aspnetcore/blazor/globalization-localization.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -244,7 +244,7 @@ Optionally, add a menu item to the navigation in the `NavMenu` component (`NavMe
244
244
245
245
## Dynamically set the culture from the `Accept-Language` header
246
246
247
-
Add the [`Microsoft.Extensions.Localization`](https://www.nuget.org/packages/Microsoft.Extensions.Localization) package to the app.
247
+
Add the [`Microsoft.Extensions.Localization` package](https://www.nuget.org/packages/Microsoft.Extensions.Localization) to the app.
248
248
249
249
The [`Accept-Language` header](https://developer.mozilla.org/docs/Web/HTTP/Headers/Accept-Language) is set by the browser and controlled by the user's language preferences in browser settings. In browser settings, a user sets one or more preferred languages in order of preference. The order of preference is used by the browser to set quality values (`q`, 0-1) for each language in the header. The following example specifies United States English, English, and Costa Rican Spanish with a preference for United States English or English:
250
250
@@ -498,7 +498,7 @@ Use the `CultureExample1` component shown in the [Demonstration component](#demo
498
498
499
499
Examples of locations where an app might store a user's preference include in [browser local storage](https://developer.mozilla.org/docs/Web/API/Window/localStorage) (common for client-side scenarios), in a localization cookie or database (common for server-side scenarios), or in an external service attached to an external database and accessed by a [web API](xref:blazor/call-web-api). The following example demonstrates how to use browser local storage.
500
500
501
-
Add the [`Microsoft.Extensions.Localization`](https://www.nuget.org/packages/Microsoft.Extensions.Localization) package to the app.
501
+
Add the [`Microsoft.Extensions.Localization` package](https://www.nuget.org/packages/Microsoft.Extensions.Localization) to the app.
502
502
503
503
[!INCLUDE[](~/includes/package-reference.md)]
504
504
@@ -713,7 +713,7 @@ Examples of locations where an app might store a user's preference include in [b
713
713
714
714
:::moniker-end
715
715
716
-
Add the [`Microsoft.Extensions.Localization`](https://www.nuget.org/packages/Microsoft.Extensions.Localization) package to the app.
716
+
Add the [`Microsoft.Extensions.Localization` package](https://www.nuget.org/packages/Microsoft.Extensions.Localization) to the app.
717
717
718
718
[!INCLUDE[](~/includes/package-reference.md)]
719
719
@@ -1023,7 +1023,7 @@ Examples of locations where an app might store a user's preference include in [b
1023
1023
1024
1024
### Updates to the `.Client` project
1025
1025
1026
-
Add the [`Microsoft.Extensions.Localization`](https://www.nuget.org/packages/Microsoft.Extensions.Localization) package to the `.Client` project.
1026
+
Add the [`Microsoft.Extensions.Localization` package](https://www.nuget.org/packages/Microsoft.Extensions.Localization) to the `.Client` project.
1027
1027
1028
1028
[!INCLUDE[](~/includes/package-reference.md)]
1029
1029
@@ -1301,7 +1301,7 @@ Add the `CultureClient`, `CultureServer`, and `CultureExample1` components to th
1301
1301
1302
1302
### Server project updates
1303
1303
1304
-
Add the [`Microsoft.Extensions.Localization`](https://www.nuget.org/packages/Microsoft.Extensions.Localization) package to the server project.
1304
+
Add the [`Microsoft.Extensions.Localization` package](https://www.nuget.org/packages/Microsoft.Extensions.Localization) to the server project.
1305
1305
1306
1306
[!INCLUDE[](~/includes/package-reference.md)]
1307
1307
@@ -1431,7 +1431,7 @@ The guidance in this section also works for components in apps that adopt per-pa
1431
1431
1432
1432
## Localization
1433
1433
1434
-
If the app doesn't already support dynamic culture selection, add the [`Microsoft.Extensions.Localization`](https://www.nuget.org/packages/Microsoft.Extensions.Localization) package to the app.
1434
+
If the app doesn't already support dynamic culture selection, add the [`Microsoft.Extensions.Localization` package](https://www.nuget.org/packages/Microsoft.Extensions.Localization) to the app.
1435
1435
1436
1436
[!INCLUDE[](~/includes/package-reference.md)]
1437
1437
@@ -1756,7 +1756,7 @@ To further understand how the Blazor framework processes localization, see the [
1756
1756
1757
1757
To create localization shared resources, adopt the following approach.
1758
1758
1759
-
* Confirm that the [`Microsoft.Extensions.Localization`](https://www.nuget.org/packages/Microsoft.Extensions.Localization) package is referenced by the project.
1759
+
* Confirm that the [`Microsoft.Extensions.Localization` package](https://www.nuget.org/packages/Microsoft.Extensions.Localization) is referenced by the project.
Copy file name to clipboardExpand all lines: aspnetcore/blazor/hybrid/security/index.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,13 +21,13 @@ Authentication in Blazor Hybrid apps is handled by native platform libraries, as
21
21
22
22
Integrating authentication must achieve the following goals for Razor components and services:
23
23
24
-
* Use the abstractions in the [`Microsoft.AspNetCore.Components.Authorization`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.Authorization) package, such as <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeView>.
24
+
* Use the abstractions in the [`Microsoft.AspNetCore.Components.Authorization` package](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.Authorization), such as <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeView>.
25
25
* React to changes in the authentication context.
26
26
* Access credentials provisioned by the app from the identity provider, such as access tokens to perform authorized API calls.
27
27
28
28
After authentication is added to a .NET MAUI, WPF, or Windows Forms app and users are able to log in and log out successfully, integrate authentication with Blazor to make the authenticated user available to Razor components and services. Perform the following steps:
29
29
30
-
* Reference the [`Microsoft.AspNetCore.Components.Authorization`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.Authorization) package.
30
+
* Reference the [`Microsoft.AspNetCore.Components.Authorization` package](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.Authorization).
31
31
32
32
[!INCLUDE[](~/includes/package-reference.md)]
33
33
@@ -563,13 +563,13 @@ Authentication in Blazor Hybrid apps is handled by native platform libraries, as
563
563
564
564
Integrating authentication must achieve the following goals for Razor components and services:
565
565
566
-
* Use the abstractions in the [`Microsoft.AspNetCore.Components.Authorization`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.Authorization) package, such as <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeView>.
566
+
* Use the abstractions in the [`Microsoft.AspNetCore.Components.Authorization` package](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.Authorization), such as <xref:Microsoft.AspNetCore.Components.Authorization.AuthorizeView>.
567
567
* React to changes in the authentication context.
568
568
* Access credentials provisioned by the app from the identity provider, such as access tokens to perform authorized API calls.
569
569
570
570
After authentication is added to a .NET MAUI, WPF, or Windows Forms app and users are able to log in and log out successfully, integrate authentication with Blazor to make the authenticated user available to Razor components and services. Perform the following steps:
571
571
572
-
* Reference the [`Microsoft.AspNetCore.Components.Authorization`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.Authorization) package.
572
+
* Reference the [`Microsoft.AspNetCore.Components.Authorization` package](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.Authorization).
Copy file name to clipboardExpand all lines: aspnetcore/blazor/security/includes/authentication-component.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ The page produced by the `Authentication` component (`Pages/Authentication.razor
2
2
3
3
The <xref:Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticatorView> component:
4
4
5
-
* Is provided by the [`Microsoft.AspNetCore.Components.WebAssembly.Authentication`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.Authentication/) package.
5
+
* Is provided by the [`Microsoft.AspNetCore.Components.WebAssembly.Authentication` package](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.Authentication/).
6
6
* Manages performing the appropriate actions at each stage of authentication.
Copy file name to clipboardExpand all lines: aspnetcore/blazor/security/webassembly/additional-scenarios.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -338,7 +338,7 @@ For a hosted Blazor solution based on the [Blazor WebAssembly project template](
338
338
339
339
:::moniker-end
340
340
341
-
Theconfigured<xref:System.Net.Http.HttpClient>isusedtomakeauthorizedrequestsusingthe [`try-catch`](/dotnet/csharp/language-reference/keywords/try-catch) pattern. Wheretheclientiscreatedwith <xref:System.Net.Http.IHttpClientFactory.CreateClient%2A> ([`Microsoft.Extensions.Http`](https://www.nuget.org/packages/Microsoft.Extensions.Http) package), the <xref:System.Net.Http.HttpClient> is supplied instances that include access tokens when making requests to the server API. If the request URI is a relative URI, as it is in the following example (`ExampleAPIMethod`), it's combined with the <xref:System.Net.Http.HttpClient.BaseAddress> when the client app makes the request:
341
+
Theconfigured<xref:System.Net.Http.HttpClient>isusedtomakeauthorizedrequestsusingthe [`try-catch`](/dotnet/csharp/language-reference/keywords/try-catch) pattern. Wheretheclientiscreatedwith <xref:System.Net.Http.IHttpClientFactory.CreateClient%2A> ([`Microsoft.Extensions.Http`package](https://www.nuget.org/packages/Microsoft.Extensions.Http)), the <xref:System.Net.Http.HttpClient> is supplied instances that include access tokens when making requests to the server API. If the request URI is a relative URI, as it is in the following example (`ExampleAPIMethod`), it's combined with the <xref:System.Net.Http.HttpClient.BaseAddress> when the client app makes the request:
342
342
343
343
```razor
344
344
@injectIHttpClientFactoryClientFactory
@@ -542,7 +542,7 @@ For a hosted Blazor solution based on the [Blazor WebAssembly project template](
Acomponentcreatesthe<xref:System.Net.Http.HttpClient>fromthe <xref:System.Net.Http.IHttpClientFactory> ([`Microsoft.Extensions.Http`](https://www.nuget.org/packages/Microsoft.Extensions.Http) package) to make unauthenticated or unauthorized requests:
545
+
Acomponentcreatesthe<xref:System.Net.Http.HttpClient>fromthe <xref:System.Net.Http.IHttpClientFactory> ([`Microsoft.Extensions.Http`package](https://www.nuget.org/packages/Microsoft.Extensions.Http)) to make unauthenticated or unauthorized requests:
WhenanappiscreatedtouseIndividualAccounts (`Individual`), theappautomaticallyreceivesapackagereferenceforthe [`Microsoft.AspNetCore.Components.WebAssembly.Authentication`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.Authentication) package. The package provides a set of primitives that help the app authenticate users and obtain tokens to call protected APIs.
253
+
WhenanappiscreatedtouseIndividualAccounts (`Individual`), theappautomaticallyreceivesapackagereferenceforthe [`Microsoft.AspNetCore.Components.WebAssembly.Authentication`package](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.Authentication). The package provides a set of primitives that help the app authenticate users and obtain tokens to call protected APIs.
254
254
255
-
Ifaddingauthenticationtoanapp, manuallyaddthe [`Microsoft.AspNetCore.Components.WebAssembly.Authentication`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.Authentication) package to the app.
255
+
Ifaddingauthenticationtoanapp, manuallyaddthe [`Microsoft.AspNetCore.Components.WebAssembly.Authentication`package](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.Authentication) to the app.
256
256
257
257
[!INCLUDE[](~/includes/package-reference.md)]
258
258
@@ -280,7 +280,7 @@ The `{PROJECT NAME}` placeholder is the project name at solution creation. For e
Thesupportforauthenticatingusersispluggedintotheservicecontainerbytheextensionmethodprovidedinsidethe [`Microsoft.AspNetCore.Components.WebAssembly.Authentication`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.Authentication) package. This method sets up the services required by the app to interact with the existing authorization system.
283
+
Thesupportforauthenticatingusersispluggedintotheservicecontainerbytheextensionmethodprovidedinsidethe [`Microsoft.AspNetCore.Components.WebAssembly.Authentication`package](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.Authentication). This method sets up the services required by the app to interact with the existing authorization system.
0 commit comments