using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace EnVisage.Code.Cache { public class RolesCache : Cache { 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); } } } }