public static List <Resource> GetResourcesByProject(Guid gProjectId) { String sKey = GetCacheKeyProjectResources(gProjectId); List <Resource> colItems = CollectionCacheManager.FetchAndCache <Resource>(sKey, delegate() { return(ResourceAccess.GetResourcesByProject(gProjectId)); }); return(colItems); }
public CollectionService(IUnitOfWork UnitOfWork, CacheManager <Collection> CollectionCacheManager, CacheManager <Source> SourceCacheManager) { collectionRepository = UnitOfWork.CollectionRepository; sourceRepository = UnitOfWork.SourceRepository; collectionCacheManager = (CollectionCacheManager)CollectionCacheManager; sourceCacheManager = (SourceCacheManager)SourceCacheManager; }
internal static void ProcessDeleteResource(Guid gProjectId, Guid gResourceId) { Resource objRes = GetResourceById(gProjectId, gResourceId); if (objRes != null) { CollectionCacheManager.RemoveItemFromCollection(GetCacheKeyProjectResources(gProjectId), objRes); } }
internal static void ProcessAddResource(Guid gProjectId, Resource objResource) { CollectionCacheManager.AddItemToCollection(GetCacheKeyProjectResources(gProjectId), objResource); }
internal static void ProcessUpdateResource(Resource objResource) { CollectionCacheManager.UpdateItem(GetCacheKeyProjectResources(objResource.Id), objResource); }
public static void ClearCacheProjectResources(Guid gProjectId) { CollectionCacheManager.ClearCollection(GetCacheKeyProjectResources(gProjectId)); }