diff --git a/src/Orchard.Web/Modules/Orchard.OutputCache/Filters/OutputCacheFilter.cs b/src/Orchard.Web/Modules/Orchard.OutputCache/Filters/OutputCacheFilter.cs index a44a443e3..5aaa07ad4 100644 --- a/src/Orchard.Web/Modules/Orchard.OutputCache/Filters/OutputCacheFilter.cs +++ b/src/Orchard.Web/Modules/Orchard.OutputCache/Filters/OutputCacheFilter.cs @@ -265,7 +265,7 @@ namespace Orchard.OutputCache.Filters { var controllerAttributes = filterContext.ActionDescriptor.ControllerDescriptor.GetCustomAttributes(typeof(OutputCacheAttribute), true); var outputCacheAttribute = actionAttributes.Concat(controllerAttributes).Cast().FirstOrDefault(); if (outputCacheAttribute != null) { - if (outputCacheAttribute.Duration <= 0 || outputCacheAttribute.NoStore || outputCacheAttribute.IsLocationAnyOf(OutputCacheLocation.Downstream, OutputCacheLocation.Client, OutputCacheLocation.None)) { + if (outputCacheAttribute.Duration <= 0 || outputCacheAttribute.NoStore || outputCacheAttribute.LocationIsIn(OutputCacheLocation.Downstream, OutputCacheLocation.Client, OutputCacheLocation.None)) { Logger.Debug("Request for item '{0}' ignored based on OutputCache attribute.", _cacheKey); return false; } diff --git a/src/Orchard.Web/Modules/Orchard.OutputCache/Helpers/OutputCacheAttributeExtensions.cs b/src/Orchard.Web/Modules/Orchard.OutputCache/Helpers/OutputCacheAttributeExtensions.cs index b34a16b8c..363c622ea 100644 --- a/src/Orchard.Web/Modules/Orchard.OutputCache/Helpers/OutputCacheAttributeExtensions.cs +++ b/src/Orchard.Web/Modules/Orchard.OutputCache/Helpers/OutputCacheAttributeExtensions.cs @@ -7,8 +7,8 @@ namespace Orchard.OutputCache.Helpers { /// /// Returns true if the Location of the specified output cache attribute matches any of the specified list of locations. /// - public static bool IsLocationAnyOf(this OutputCacheAttribute attribute, params OutputCacheLocation[] locations) { - return locations.Any(x => attribute.Location == x); + public static bool LocationIsIn(this OutputCacheAttribute attribute, params OutputCacheLocation[] locations) { + return locations.Contains(attribute.Location); } } } \ No newline at end of file