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.
35 lines
853 B
C#
35 lines
853 B
C#
using VOL.Core.Enums;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace VOL.Core.Extensions
|
|
{
|
|
public static class CacheKeyExtensions
|
|
{
|
|
public static string GetKey(this CPrefix prefix, object value)
|
|
{
|
|
return prefix.ToString() + value;
|
|
}
|
|
|
|
public static string GetUserIdKey(this Guid userId)
|
|
{
|
|
return CPrefix.UID.ToString() + userId;
|
|
}
|
|
|
|
public static string GetRoleIdKey(this string roleId)
|
|
{
|
|
return CPrefix.Role.ToString() + roleId;
|
|
}
|
|
public static bool isNullorEmpty(this Guid _guid)
|
|
{
|
|
return (_guid == null || _guid == Guid.Empty);
|
|
}
|
|
|
|
|
|
public static bool isNullorEmpty<TDetail>(this List<TDetail> list)
|
|
{
|
|
return (list==null || list.Count==0);
|
|
}
|
|
}
|
|
}
|