Skip to content

Instantly share code, notes, and snippets.

@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)
@leekelleher
leekelleher / MyApplication.cs
Last active December 19, 2015 13:59
Example of Umbraco 6.1's IContentFinder
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web.Mvc;
using Umbraco.Web.Routing;
namespace Our.Umbraco
{
public class MyApplication : ApplicationEventHandler
{
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)