From 6641b0e3f9e275792aeac9de9cb4dc4348586f92 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Tue, 30 Jan 2024 17:56:24 -0800 Subject: [PATCH] Fix string comparison changes in YesSql queries --- .../Services/AliasPartContentHandleProvider.cs | 2 +- src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Alias/Services/AliasPartContentHandleProvider.cs b/src/OrchardCore.Modules/OrchardCore.Alias/Services/AliasPartContentHandleProvider.cs index 1f961b1440d..fc0dd6ecc64 100644 --- a/src/OrchardCore.Modules/OrchardCore.Alias/Services/AliasPartContentHandleProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.Alias/Services/AliasPartContentHandleProvider.cs @@ -34,6 +34,6 @@ public async Task GetContentItemIdAsync(string handle) internal class AliasPartContentHandleHelper { internal static Task QueryAliasIndex(ISession session, string alias) => - session.Query(x => x.Alias.Equals(alias, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefaultAsync(); + session.Query(x => x.Alias == alias.ToLowerInvariant()).FirstOrDefaultAsync(); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs index de8be159574..7346fd590dd 100644 --- a/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Alias/Startup.cs @@ -39,7 +39,7 @@ public override void ConfigureServices(IServiceCollection services) var session = context.Services.GetRequiredService(); var contentItem = await session.Query(x => - x.Published && x.Alias.Equals(alias, System.StringComparison.InvariantCultureIgnoreCase)) + x.Published && x.Alias == alias.ToLowerInvariant()) .FirstOrDefaultAsync(); if (contentItem == null)