添加项目文件。

This commit is contained in:
Zel
2025-01-22 23:31:03 +08:00
parent 1b8ba6771f
commit 2ae76476fb
894 changed files with 774558 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
using System.Runtime.CompilerServices;
using static TightWiki.Caching.WikiCache;
namespace TightWiki.Caching
{
/// <summary>
/// Contains a verbatim cache key which also includes the calling function name.
/// </summary>
/// <param name="key"></param>
public class WikiCacheKeyFunction(string key) : IWikiCacheKey
{
public string Key { get; set; } = key;
/// <summary>
/// Builds a cache key which includes the calling function name.
/// </summary>
public static WikiCacheKeyFunction Build(Category category, object?[] segments, [CallerMemberName] string callingFunction = "")
=> new($"[{category}]:[{string.Join("]:[", segments)}]:[{callingFunction}]");
/// <summary>
/// Builds a cache key which includes the calling function name.
/// </summary>
public static WikiCacheKeyFunction Build(Category category, [CallerMemberName] string callingFunction = "")
=> new($"[{category}]:[{callingFunction}]");
}
}