2018-10-19 23:09:52 +08:00
|
|
|
|
using Bootstrap.Security;
|
2018-10-25 17:52:04 +08:00
|
|
|
|
using Bootstrap.Security.SQLServer;
|
2018-10-28 21:05:22 +08:00
|
|
|
|
using Longbow.Cache;
|
2018-10-19 23:09:52 +08:00
|
|
|
|
|
|
|
|
|
namespace Bootstrap.Client.DataAccess
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 用户表相关操作类
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class UserHelper
|
|
|
|
|
{
|
2018-10-28 21:05:22 +08:00
|
|
|
|
public const string RetrieveUsersByNameDataKey = "BootstrapUser-RetrieveUsersByName";
|
2018-10-19 23:09:52 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userName"></param>
|
|
|
|
|
/// <returns></returns>
|
2018-10-28 21:05:22 +08:00
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
}
|