From 7cddda23e689bae43ea422c1ab608b03e04e1ea7 Mon Sep 17 00:00:00 2001 From: Maksym Sadovnychyy Date: Sun, 15 Dec 2024 01:12:46 +0100 Subject: [PATCH] (feature): TryGetOperation property name case insensitive --- .../Abstractions/Webapi/PatchRequestModelBase.cs | 8 ++++++++ src/MaksIT.Core/MaksIT.Core.csproj | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/MaksIT.Core/Abstractions/Webapi/PatchRequestModelBase.cs b/src/MaksIT.Core/Abstractions/Webapi/PatchRequestModelBase.cs index 35be9b2..19be0f1 100644 --- a/src/MaksIT.Core/Abstractions/Webapi/PatchRequestModelBase.cs +++ b/src/MaksIT.Core/Abstractions/Webapi/PatchRequestModelBase.cs @@ -16,7 +16,15 @@ public abstract class PatchRequestModelBase : RequestModelBase { .Where(prop => prop.Name != nameof(Operations)) .Any(prop => prop.GetValue(this) != null); + /// + /// Attempts to retrieve the patch operation associated with the specified property name (case insensitive). + /// + /// The name of the property for which to retrieve the patch operation. + /// When this method returns, contains the patch operation associated with the specified property name, if the key is found; otherwise, null. + /// true if the patch operation is found; otherwise, false. public bool TryGetOperation(string propertyName, [NotNullWhen(true)] out PatchOperation? operation) { + propertyName = propertyName.ToLower(); + if (Operations == null) { operation = null; return false; diff --git a/src/MaksIT.Core/MaksIT.Core.csproj b/src/MaksIT.Core/MaksIT.Core.csproj index 79504d9..7b96e24 100644 --- a/src/MaksIT.Core/MaksIT.Core.csproj +++ b/src/MaksIT.Core/MaksIT.Core.csproj @@ -8,7 +8,7 @@ MaksIT.Core - 1.2.6 + 1.2.7 Maksym Sadovnychyy MAKS-IT MaksIT.Core