Skip to content

Instantly share code, notes, and snippets.

View alanmac's full-sized avatar

Alan Mac Kenna alanmac

View GitHub Profile
@alanmac
alanmac / UmbracoDonutOutputCacheAttribute.cs
Created September 18, 2015 11:31
This is a DonutOutputCache attribute extension that checks for use of Umbraco Doc Type Grid Editor. It's useful in the backoffice if Donut Output Caching is being used and it is throwing exceptions trying to cache DTGE in the backoffice
/// <summary>
/// Used to stop Donut Caching from executing on the request if the Doc Type Grid Editor is being used in the backoffice
/// Put this attribute on the Controller/Method that is causing a problem in the backoffice.
/// e.g. [UmbracoDonutOutputCacheAttribute(CacheProfile = "FiveMin")]
// public ActionResult Home()
/// </summary>
public class UmbracoDonutOutputCacheAttribute : DonutOutputCacheAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)