0
0
mirror of https://github.com/alex289/CleanArchitecture.git synced 2025-06-30 02:31:08 +00:00
CleanArchitecture/CleanArchitecture.Domain/CacheKeyGenerator.cs
2023-08-31 21:08:46 +02:00

13 lines
393 B
C#

using System;
using CleanArchitecture.Domain.Entities;
namespace CleanArchitecture.Domain;
public static class CacheKeyGenerator
{
public static string GetEntityCacheKey<TEntity>(TEntity entity) where TEntity : Entity =>
$"{typeof(TEntity)}-{entity.Id}";
public static string GetEntityCacheKey<TEntity>(Guid id) where TEntity : Entity =>
$"{typeof(TEntity)}-{id}";
}