refactor(ModifyDocStatusCommandBase): add EnvelopeId and ReceiverId properties

This commit is contained in:
2025-09-09 23:15:19 +02:00
parent 83ff3da795
commit 6b89b9bbf2
9 changed files with 101 additions and 10 deletions

View File

@@ -3,10 +3,22 @@ using Microsoft.Extensions.Caching.Memory;
namespace EnvelopeGenerator.Application.Common.Extensions;
/// <summary>
///
/// </summary>
public static class MemoryCacheExtensions
{
private static readonly Guid BaseId = Guid.NewGuid();
/// <summary>
///
/// </summary>
/// <typeparam name="TEnum"></typeparam>
/// <param name="memoryCache"></param>
/// <param name="key"></param>
/// <param name="ignores"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
public static IDictionary<string, int> GetEnumAsDictionary<TEnum>(this IMemoryCache memoryCache, string key = "", params object[] ignores)
where TEnum : Enum
=> memoryCache.GetOrCreate(BaseId + typeof(TEnum).FullName + key, _ =>