using Bootstrap.Security.DataAccess;
using Longbow.Cache;
using System.Collections.Generic;
namespace Bootstrap.Client.DataAccess
{
///
///
///
public static class RoleHelper
{
private const string RetrieveRolesByUserNameDataKey = "RoleHelper-RetrieveRolesByUserName";
private const string RetrieveRolesByUrlDataKey = "RoleHelper-RetrieveRolesByUrl";
///
///
///
///
///
public static IEnumerable RetrieveRolesByUserName(string userName) => CacheManager.GetOrAdd(string.Format("{0}-{1}", RetrieveRolesByUserNameDataKey, userName), key => DbHelper.RetrieveRolesByUserName(userName), RetrieveRolesByUserNameDataKey);
///
///
///
///
///
public static IEnumerable RetrieveRolesByUrl(string url) => CacheManager.GetOrAdd(string.Format("{0}-{1}", RetrieveRolesByUrlDataKey, url), key => DbHelper.RetrieveRolesByUrl(url), RetrieveRolesByUrlDataKey);
}
}