From cb2f40b16c795319f8f738bb1f577c4238c7316e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Tue, 2 Jun 2026 17:06:34 +0200 Subject: [PATCH] Avoid using the KeyValuePair.Create() polyfill in ASP.NET MVC 5.3 views --- Directory.Packages.props | 2 +- .../Views/Authorization/Authorize.cshtml | 4 ++-- .../Views/Authorization/EndSession.cshtml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 9df6af2b..53280987 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -172,7 +172,7 @@ on some of the targeted TFMs (e.g Index, Range or nullable attributes on .NET Framework/.NET Standard). --> - + diff --git a/sandbox/OpenIddict.Sandbox.AspNet.Server/Views/Authorization/Authorize.cshtml b/sandbox/OpenIddict.Sandbox.AspNet.Server/Views/Authorization/Authorize.cshtml index f7ce3eb5..c2241406 100644 --- a/sandbox/OpenIddict.Sandbox.AspNet.Server/Views/Authorization/Authorize.cshtml +++ b/sandbox/OpenIddict.Sandbox.AspNet.Server/Views/Authorization/Authorize.cshtml @@ -14,10 +14,10 @@ foreach (var parameter in string.Equals(Request.HttpMethod, "POST", StringComparison.OrdinalIgnoreCase) ? from name in Request.Form.AllKeys from value in Request.Form.GetValues(name) - select KeyValuePair.Create(name, value) : + select new KeyValuePair(name, value) : from name in Request.QueryString.AllKeys from value in Request.QueryString.GetValues(name) - select KeyValuePair.Create(name, value)) + select new KeyValuePair(name, value)) { } diff --git a/sandbox/OpenIddict.Sandbox.AspNet.Server/Views/Authorization/EndSession.cshtml b/sandbox/OpenIddict.Sandbox.AspNet.Server/Views/Authorization/EndSession.cshtml index 3f254754..4d270f90 100644 --- a/sandbox/OpenIddict.Sandbox.AspNet.Server/Views/Authorization/EndSession.cshtml +++ b/sandbox/OpenIddict.Sandbox.AspNet.Server/Views/Authorization/EndSession.cshtml @@ -12,10 +12,10 @@ foreach (var parameter in string.Equals(Request.HttpMethod, "POST", StringComparison.OrdinalIgnoreCase) ? from name in Request.Form.AllKeys from value in Request.Form.GetValues(name) - select KeyValuePair.Create(name, value) : + select new KeyValuePair(name, value) : from name in Request.QueryString.AllKeys from value in Request.QueryString.GetValues(name) - select KeyValuePair.Create(name, value)) + select new KeyValuePair(name, value)) { }