mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-06-29 18:21:08 +00:00
17 lines
425 B
C#
17 lines
425 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
|
|
{
|
|
return $"{typeof(TEntity)}-{entity.Id}";
|
|
}
|
|
|
|
public static string GetEntityCacheKey<TEntity>(Guid id) where TEntity : Entity
|
|
{
|
|
return $"{typeof(TEntity)}-{id}";
|
|
}
|
|
} |