BootstrapAdmin/Bootstrap.Client.DataAccess/UserHelper.cs

21 lines
719 B
C#
Raw Normal View History

2018-10-19 23:09:52 +08:00
using Bootstrap.Security;
using Bootstrap.Security.SQLServer;
using Longbow.Cache;
2018-10-19 23:09:52 +08:00
namespace Bootstrap.Client.DataAccess
{
/// <summary>
/// 用户表相关操作类
/// </summary>
public static class UserHelper
{
public const string RetrieveUsersByNameDataKey = "BootstrapUser-RetrieveUsersByName";
2018-10-19 23:09:52 +08:00
/// <summary>
///
/// </summary>
/// <param name="userName"></param>
/// <returns></returns>
public static BootstrapUser RetrieveUserByUserName(string userName) => CacheManager.GetOrAdd(string.Format("{0}-{1}", RetrieveUsersByNameDataKey, userName), k => BASQLHelper.RetrieveUserByUserName(userName), RetrieveUsersByNameDataKey);
2018-10-19 23:09:52 +08:00
}
}