From 3b449f0101743f3cebfa029913d27c3b35a920a4 Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Thu, 22 Aug 2024 21:09:06 -0500 Subject: [PATCH] Fix cache key issue. --- .../BotSharp.Abstraction/Infrastructures/SharpCacheAttribute.cs | 2 +- src/Infrastructure/BotSharp.Abstraction/Utilities/Pagination.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Infrastructure/BotSharp.Abstraction/Infrastructures/SharpCacheAttribute.cs b/src/Infrastructure/BotSharp.Abstraction/Infrastructures/SharpCacheAttribute.cs index e788fc0c..957ff241 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Infrastructures/SharpCacheAttribute.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Infrastructures/SharpCacheAttribute.cs @@ -43,7 +43,7 @@ public class SharpCacheAttribute : MoAttribute private string GetCacheKey(MethodContext context) { - var key = _prefix; + var key = _prefix + "-" + context.Method.Name; foreach (var arg in context.Arguments) { if (arg is null) diff --git a/src/Infrastructure/BotSharp.Abstraction/Utilities/Pagination.cs b/src/Infrastructure/BotSharp.Abstraction/Utilities/Pagination.cs index bb5d74e4..8d6d0e0d 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Utilities/Pagination.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Utilities/Pagination.cs @@ -43,7 +43,7 @@ public class Pagination : ICacheKey public bool ReturnTotal { get; set; } = true; public string GetCacheKey() - => $"{_page}_{_size}_{Sort}_{Order}"; + => $"{nameof(Pagination)}_{_page}_{_size}_{Sort}_{Order}"; } public class PagedItems