BootstrapAdmin/Bootstrap.Client.DataAccess/UserHelper.cs

21 lines
718 B
C#
Raw Normal View History

2018-10-19 23:09:52 +08:00
using Bootstrap.Security;
using Bootstrap.Security.DataAccess;
using Longbow.Cache;
2018-10-19 23:09:52 +08:00
namespace Bootstrap.Client.DataAccess
{
/// <summary>
/// 用户表相关操作类
/// </summary>
public static class UserHelper
{
2019-05-02 00:03:07 +08:00
private 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 => DbHelper.RetrieveUserByUserName(userName), RetrieveUsersByNameDataKey);
2018-10-19 23:09:52 +08:00
}
}