1
This commit is contained in:
23
iMES.Core/Extensions/CacheKeyExtensions.cs
Normal file
23
iMES.Core/Extensions/CacheKeyExtensions.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using iMES.Core.Enums;
|
||||
using System;
|
||||
|
||||
namespace iMES.Core.Extensions
|
||||
{
|
||||
public static class CacheKeyExtensions
|
||||
{
|
||||
public static string GetKey(this CPrefix prefix, object value)
|
||||
{
|
||||
return prefix.ToString() + value;
|
||||
}
|
||||
|
||||
public static string GetUserIdKey(this int userId)
|
||||
{
|
||||
return CPrefix.UID.ToString() + userId;
|
||||
}
|
||||
|
||||
public static string GetRoleIdKey(this int roleId)
|
||||
{
|
||||
return CPrefix.Role.ToString() + roleId;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user