public static void RemoveMemberTypeCache(this DistributedCache dc, IMemberType memberType) { if (memberType == null) { return; } dc.RefreshByJson(DistributedCache.ContentTypeCacheRefresherGuid, ContentTypeCacheRefresher.SerializeToJsonPayload(true, memberType)); }
public static void RefreshContentTypeCache(this DistributedCache dc, IContentType contentType) { if (contentType == null) { return; } dc.RefreshByJson(DistributedCache.ContentTypeCacheRefresherGuid, ContentTypeCacheRefresher.SerializeToJsonPayload(false, contentType)); }
/// <summary> /// Remove all cache for a given media type /// </summary> /// <param name="dc"></param> /// <param name="mediaType"></param> public static void RemoveMediaTypeCache(this DistributedCache dc, IMediaType mediaType) { if (mediaType != null) { //dc.Remove(new Guid(DistributedCache.ContentTypeCacheRefresherId), x => x.Id, mediaType); dc.RefreshByJson(new Guid(DistributedCache.ContentTypeCacheRefresherId), ContentTypeCacheRefresher.SerializeToJsonPayload(true, mediaType)); } }
/// <summary> /// Remove all cache for a given content type /// </summary> /// <param name="dc"></param> /// <param name="contentType"></param> public static void RefreshContentTypeCache(this DistributedCache dc, IContentType contentType) { if (contentType != null) { //dc.Refresh(new Guid(DistributedCache.ContentTypeCacheRefresherId), x => x.Id, contentType); dc.RefreshByJson(new Guid(DistributedCache.ContentTypeCacheRefresherId), ContentTypeCacheRefresher.SerializeToJsonPayload(false, contentType)); } }