EnVisageOnline/Main/Source/EnVisage/Code/Cache/RolesCache.cs

27 lines
498 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace EnVisage.Code.Cache
{
public class RolesCache : Cache<AspNetRole>
{
protected override string CACHE_KEY
{
get
{
return "Roles";
}
}
protected override void SetValuesToCache()
{
using (EnVisageEntities context = new EnVisageEntities())
{
var value = context.AspNetRoles.AsNoTracking().ToList();
CacheManager.Instance.AddToCache(CACHE_KEY, value);
}
}
}
}