27 lines
498 B
C#
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);
|
|
}
|
|
}
|
|
}
|
|
} |