string template = "Hello @Model.Name, welcome to RazorEngine!";
var result = Engine.Razor.RunCompile(template, "templateKey", null, new { Name = "World" });
Now i update my existing template to as below. I get my template from database.
string template = "Hello @Model.Name, welcome to My World!";
Whenever i do that i get an error The same key was already used for another template.
What is the best way to fix this issue?
Engine.Razor.IsTemplateCached
and useRun
instead ofRunCompile
if it's already there. – Disannul