You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
759 B
C#

using Volo.Abp;
using Volo.Abp.MultiTenancy;
namespace NPin.Framework.TenantManagement.Domain;
[Serializable]
[IgnoreMultiTenancy]
public class TenantCacheItem
{
private const string CacheKeyFormat = "i:{0},n:{1}";
public TenantConfiguration Value { get; set; }
public TenantCacheItem()
{
}
public TenantCacheItem(TenantConfiguration value)
{
Value = value;
}
public static string CalculateCacheKey(Guid? id, string name)
{
if (id == null && name.IsNullOrWhiteSpace())
{
throw new AbpException("Id和Name都为空");
}
return string.Format(CacheKeyFormat,
id?.ToString() ?? "null",
name.IsNullOrWhiteSpace() ? "null" : name);
}
}