mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-06-30 02:31:08 +00:00
13 lines
393 B
C#
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}";
|
|
} |