Fixes some underlying type conversions, fixes more of the member type wrapping, updates contenttypecontrolnew to work with member types properly, ensures the property type cache is cleared when member types change.

This commit is contained in:
Shannon
2014-01-23 13:33:58 +11:00
parent 011be60205
commit 6377b9aa50
6 changed files with 197 additions and 127 deletions

View File

@@ -353,7 +353,7 @@ namespace Umbraco.Web.Cache
}
#endregion
#region Content type cache
#region Document type cache
/// <summary>
/// Remove all cache for a given content type
@@ -364,27 +364,11 @@ namespace Umbraco.Web.Cache
{
if (contentType != null)
{
//dc.Refresh(new Guid(DistributedCache.ContentTypeCacheRefresherId), x => x.Id, contentType);
dc.RefreshByJson(new Guid(DistributedCache.ContentTypeCacheRefresherId),
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 RefreshMediaTypeCache(this DistributedCache dc, IMediaType mediaType)
{
if (mediaType != null)
{
//dc.Refresh(new Guid(DistributedCache.ContentTypeCacheRefresherId), x => x.Id, mediaType);
dc.RefreshByJson(new Guid(DistributedCache.ContentTypeCacheRefresherId),
ContentTypeCacheRefresher.SerializeToJsonPayload(false, mediaType));
}
}
/// <summary>
/// Remove all cache for a given content type
/// </summary>
@@ -394,12 +378,29 @@ namespace Umbraco.Web.Cache
{
if (contentType != null)
{
//dc.Remove(new Guid(DistributedCache.ContentTypeCacheRefresherId), x => x.Id, contentType);
dc.RefreshByJson(new Guid(DistributedCache.ContentTypeCacheRefresherId),
ContentTypeCacheRefresher.SerializeToJsonPayload(true, contentType));
}
}
#endregion
#region Media type cache
/// <summary>
/// Remove all cache for a given media type
/// </summary>
/// <param name="dc"></param>
/// <param name="mediaType"></param>
public static void RefreshMediaTypeCache(this DistributedCache dc, IMediaType mediaType)
{
if (mediaType != null)
{
dc.RefreshByJson(new Guid(DistributedCache.ContentTypeCacheRefresherId),
ContentTypeCacheRefresher.SerializeToJsonPayload(false, mediaType));
}
}
/// <summary>
/// Remove all cache for a given media type
/// </summary>
@@ -409,13 +410,46 @@ namespace Umbraco.Web.Cache
{
if (mediaType != null)
{
//dc.Remove(new Guid(DistributedCache.ContentTypeCacheRefresherId), x => x.Id, mediaType);
dc.RefreshByJson(new Guid(DistributedCache.ContentTypeCacheRefresherId),
ContentTypeCacheRefresher.SerializeToJsonPayload(true, mediaType));
}
}
}
#endregion
#region Media type cache
/// <summary>
/// Remove all cache for a given media type
/// </summary>
/// <param name="dc"></param>
/// <param name="memberType"></param>
public static void RefreshMemberTypeCache(this DistributedCache dc, IMemberType memberType)
{
if (memberType != null)
{
dc.RefreshByJson(new Guid(DistributedCache.ContentTypeCacheRefresherId),
ContentTypeCacheRefresher.SerializeToJsonPayload(false, memberType));
}
}
/// <summary>
/// Remove all cache for a given media type
/// </summary>
/// <param name="dc"></param>
/// <param name="memberType"></param>
public static void RemoveMemberTypeCache(this DistributedCache dc, IMemberType memberType)
{
if (memberType != null)
{
dc.RefreshByJson(new Guid(DistributedCache.ContentTypeCacheRefresherId),
ContentTypeCacheRefresher.SerializeToJsonPayload(true, memberType));
}
}
#endregion
#region Stylesheet Cache
public static void RefreshStylesheetPropertyCache(this DistributedCache dc, global::umbraco.cms.businesslogic.web.StylesheetProperty styleSheetProperty)