RazorEngine.Razor.Parse clear cache

May 16, 2014 at 12:57 PM
I am using a foreach statement to parse a number of templates. So I have to parse a number of templates using the same model.

The first parse returns the correct html however all remaining parsers continue to return the first html aswell, almost if it cached.

Simple example code:

string html = string.empty;
List<string> t = GetListOfTemplates();

foreach(var t in templates)
{
html = RazorEngine.razor.Parse(t, model, "myRazor");
//Do Something with 'html'
}