Created
March 20, 2016 22:28
-
-
Save casper-rasmussen/87aec6bb089d9d1b0e66 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void PurgeOutputCacheByContent(IContent content) | |
{ | |
IEnumerable<TemplateModel> templateModels = this._templateModelRepository.List(content.GetOriginalType()); | |
RouteValueDictionary routeValues = new RouteValueDictionary(); | |
routeValues.Add("currentcontent", content); | |
foreach (TemplateModel model in templateModels) | |
{ | |
string controllerName = model.Name.Replace("Controller", ""); | |
this._outputCacheManager.RemoveItems(controllerName, "Index", routeValues); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment