From 469622aad8554262fa34780e1fb2b732d0d4f360 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Mon, 15 Jun 2026 04:26:57 +0330 Subject: [PATCH] last ... --- Providers/XCategoryProvider.cs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Providers/XCategoryProvider.cs b/Providers/XCategoryProvider.cs index 1dbb481..29b2c92 100644 --- a/Providers/XCategoryProvider.cs +++ b/Providers/XCategoryProvider.cs @@ -783,6 +783,10 @@ namespace xCategoryService.Providers { // // Handle Update ... + result = await GetResource( + id: id, + cancellationToken: cancellationToken + ); // #region Remove ... @@ -824,7 +828,12 @@ namespace xCategoryService.Providers // // Titles ... var updateTitles = result.Titles.Locales.Where( - l => resource.Titles.Locales.Any(r => r.Language.Equals(l.Language, System.StringComparison.InvariantCultureIgnoreCase)) + l => resource.Titles.Locales.Any(r => + r.Value + .Equals(l.Value, StringComparison.InvariantCultureIgnoreCase) && + r.Language + .Equals(l.Language, StringComparison.InvariantCultureIgnoreCase) + ) ); foreach (var locale in updateTitles) { @@ -840,7 +849,11 @@ namespace xCategoryService.Providers // // Descriptions ... var updateDescriptions = result.Descriptions.Locales.Where( - l => resource.Descriptions.Locales.Any(r => r.Language.Equals(l.Language, System.StringComparison.InvariantCultureIgnoreCase)) + l => resource.Descriptions.Locales.Any(r => + r.Value + .Equals(l.Value, StringComparison.InvariantCultureIgnoreCase) && + r.Language + .Equals(l.Language, StringComparison.InvariantCultureIgnoreCase)) ); foreach (var locale in updateDescriptions) { @@ -859,7 +872,7 @@ namespace xCategoryService.Providers // // Titles ... var newTitles = resource.Titles.Locales.Where( - l => !result.Titles.Locales.Any(r => r.Language.Equals(l.Language, System.StringComparison.InvariantCultureIgnoreCase)) + l => !result.Titles.Locales.Any(r => r.Language.Equals(l.Language, StringComparison.InvariantCultureIgnoreCase)) ); foreach (var locale in newTitles) { @@ -875,7 +888,7 @@ namespace xCategoryService.Providers // // Descriptions ... var newDescriptions = resource.Descriptions.Locales.Where( - l => !result.Descriptions.Locales.Any(r => r.Language.Equals(l.Language, System.StringComparison.InvariantCultureIgnoreCase)) + l => !result.Descriptions.Locales.Any(r => r.Language.Equals(l.Language, StringComparison.InvariantCultureIgnoreCase)) ); foreach (var locale in newDescriptions) {