Skip to content

Commit aa90b31

Browse files
Merge pull request #35272 from dotnet/main
Merge to Live
2 parents b172038 + 77e9869 commit aa90b31

File tree

6 files changed

+41
-4
lines changed

6 files changed

+41
-4
lines changed

aspnetcore/blazor/security/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ The authentication context is only established when the app starts, which is whe
9696

9797
If the app must capture users for custom services or react to updates to the user, see <xref:blazor/security/additional-scenarios#circuit-handler-to-capture-users-for-custom-services>.
9898

99-
Blazor differs from a traditional server-rendered web apps that make new HTTP requests with cookies on every page navigation. Authentication is checked during navigation events. However, cookies aren't involved. Cookies are only sent when making an HTTP request to a server, which isn't what happens when the user navigates in a Blazor app. During navigation, the user's authentication state is checked within the Blazor circuit, which you can update at any time on the server using the [`RevalidatingAuthenticationStateProvider` abstraction](#additional-security-abstractions).
99+
Blazor differs from traditional server-rendered web apps that make new HTTP requests with cookies on every page navigation. Authentication is checked during navigation events. However, cookies aren't involved. Cookies are only sent when making an HTTP request to a server, which isn't what happens when the user navigates in a Blazor app. During navigation, the user's authentication state is checked within the Blazor circuit, which you can update at any time on the server using the [`RevalidatingAuthenticationStateProvider` abstraction](#additional-security-abstractions).
100100

101101
> [!IMPORTANT]
102102
> Implementing a custom `NavigationManager` to achieve authentication validation during navigation isn't recommended. If the app must execute custom authentication state logic during navigation, use a [custom `AuthenticationStateProvider`](xref:blazor/security/authentication-state#implement-a-custom-authenticationstateprovider).

aspnetcore/data/ef-mvc/sort-filter-page.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ You've added a `searchString` parameter to the `Index` method. The search string
8888
> [!NOTE]
8989
> Here you are calling the `Where` method on an `IQueryable` object, and the filter will be processed on the server. In some scenarios you might be calling the `Where` method as an extension method on an in-memory collection. (For example, suppose you change the reference to `_context.Students` so that instead of an EF `DbSet` it references a repository method that returns an `IEnumerable` collection.) The result would normally be the same but in some cases may be different.
9090
>
91-
>For example, the .NET Framework implementation of the `Contains` method performs a case-sensitive comparison by default, but in SQL Server this is determined by the collation setting of the SQL Server instance. That setting defaults to case-insensitive. You could call the `ToUpper` method to make the test explicitly case-insensitive: *Where(s => s.LastName.ToUpper().Contains(searchString.ToUpper())*. That would ensure that results stay the same if you change the code later to use a repository which returns an `IEnumerable` collection instead of an `IQueryable` object. (When you call the `Contains` method on an `IEnumerable` collection, you get the .NET Framework implementation; when you call it on an `IQueryable` object, you get the database provider implementation.) However, there's a performance penalty for this solution. The `ToUpper` code would put a function in the WHERE clause of the TSQL SELECT statement. That would prevent the optimizer from using an index. Given that SQL is mostly installed as case-insensitive, it's best to avoid the `ToUpper` code until you migrate to a case-sensitive data store.
91+
>For example, the .NET Framework implementation of the `Contains` method performs a case-sensitive comparison by default, but in SQL Server this is determined by the collation setting of the SQL Server instance. That setting defaults to case-insensitive. You could call the `ToUpper` method to make the test explicitly case-insensitive: *Where(s => s.LastName.ToUpper().Contains(searchString.ToUpper())*. That would ensure that results stay the same if you change the code later to use a repository which returns an `IEnumerable` collection instead of an `IQueryable` object. (When you call the `Contains` method on an `IEnumerable` collection, you get the .NET Framework implementation; when you call it on an `IQueryable` object, you get the database provider implementation.) However, there's a performance penalty for this solution. The `ToUpper` code would put a function in the WHERE clause of the TSQL SELECT statement. That would prevent the optimizer from using an index. Given that SQL is mostly installed as case-insensitive, it's best to avoid the `ToUpper` code until you migrate to a case-insensitive data store.
9292
9393
### Add a Search Box to the Student Index View
9494

aspnetcore/fundamentals/configuration/options.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Discover how to use the options pattern to represent groups of rela
55
monikerRange: '>= aspnetcore-3.1'
66
ms.author: tdykstra
77
ms.custom: mvc
8-
ms.date: 01/13/2022
8+
ms.date: 04/19/2025
99
uid: fundamentals/configuration/options
1010
---
1111
# Options pattern in ASP.NET Core
@@ -108,6 +108,22 @@ In the preceding code, by default, changes to the JSON configuration file after
108108

109109
<a name="named"></a>
110110

111+
## Specify a custom key name for a configuration property using `ConfigurationKeyName`
112+
113+
By default, the property names of the options class are used as the key name in the configuration source. If the property name is `Title`, the key name in the configuration is `Title` as well.
114+
115+
When the names differentiate, you can use the [`ConfigurationKeyName` attribute](xref:Microsoft.Extensions.Configuration.ConfigurationKeyNameAttribute) to specify the key name in the configuration source. Using this technique, you can map a property in the configuration to one in your code with a different name.
116+
117+
This is useful when the property name in the configuration source isn't a valid C# identifier or when you want to use a different name in your code.
118+
119+
For example, consider the following options class:
120+
121+
:::code language="csharp" source="~/fundamentals/configuration/options/samples/6.x/OptionsSample/Models/PositionOptionsWithConfigurationKeyName.cs" id="snippet":::
122+
123+
The `Title` and `Name` class properties are bound to the `position-title` and `position-name` from the following `appsettings.json` file:
124+
125+
:::code language="json" source="~/fundamentals/configuration/options/samples/6.x/OptionsSample/appsettings.KN.json":::
126+
111127
## Named options support using IConfigureNamedOptions
112128

113129
Named options:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace SampleApp.Models
2+
{
3+
#region snippet
4+
public class PositionOptionsWithConfigurationKeyName
5+
{
6+
public const string Position = "Position";
7+
8+
[ConfigurationKeyName("position-title")]
9+
public string Title { get; set; } = string.Empty;
10+
11+
[ConfigurationKeyName("position-name")]
12+
public string Name { get; set; } = string.Empty;
13+
}
14+
#endregion
15+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"Position": {
3+
"position-title": "Editor",
4+
"position-name": "Joe Smith"
5+
}
6+
}

aspnetcore/grpc/interceptors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ gRPC client interceptors intercept outgoing RPC invocations. They provide access
3535

3636
`Interceptor` methods to override for client:
3737

38-
* `BlockingUnaryCall`: Intercepts a blocking invocation of an unary RPC.
38+
* `BlockingUnaryCall`: Intercepts a blocking invocation of a unary RPC.
3939
* `AsyncUnaryCall`: Intercepts an asynchronous invocation of an unary RPC.
4040
* `AsyncClientStreamingCall`: Intercepts an asynchronous invocation of a client-streaming RPC.
4141
* `AsyncServerStreamingCall`: Intercepts an asynchronous invocation of a server-streaming RPC.

0 commit comments

Comments
 (0)