I receive a compile error in my environment. It appears as if the parameter error is missing a type. Therefore I changed the signature to the following:
public static string RenderTemplate(string template, object model, out string error)
and as a consequence added the following as a first line in the method:
error = string.Empty;
And - using latest C# syntax - the call using this class should then be changed to
AppTemplates.RenderTemplate("~/header.cshtml", topic, out string error);
Admittedly the class is only meant to give a starting point. I think, though, that it should be syntactically correct. Perhaps I'm overlooking something, though.
Landing page at https://github.com/RickStrahl/Westwind.RazorHosting contains an example class
AppTamplate
with a method namedRenderTemplate()
I receive a compile error in my environment. It appears as if the parameter
error
is missing a type. Therefore I changed the signature to the following:public static string RenderTemplate(string template, object model, out string error)
and as a consequence added the following as a first line in the method:
error = string.Empty;
And - using latest C# syntax - the call using this class should then be changed to
AppTemplates.RenderTemplate("~/header.cshtml", topic, out string error);
Admittedly the class is only meant to give a starting point. I think, though, that it should be syntactically correct. Perhaps I'm overlooking something, though.