RazorEngine
RazorEngine copied to clipboard
Less than not supported in templates
I have a template with the following snippet:
if (A < B)
RazorEngine compiles this to:
if (A WriteLiteral("< B)\n {");
This is inside a @{} Razor code block, so the less than in this case should not be treated as the start of a HTML tag.
A messy workaround in the interim is to:
A) Move the condition into your model, by exposing a LessThan(A, B) method; or
B) Inverse the condition ie if (!(A >= B))