Appearance
InterpolateMustache Method
Definition
- Namespace:
JASE.Extensions - Assembly:
JASE.ReflectionTools.dll
string InterpolateMustache(string input, object model, bool preserveMissingProperties = null, bool htmlEncodeValues = null)
csharp
string InterpolateMustache(string input, object model, bool preserveMissingProperties = null, bool htmlEncodeValues = null)Replaces Mustache-style double-brace placeholders {{property}} with values from model.
Parameters
| Name | Description |
|---|---|
htmlEncodeValues | When (default), HTML-encode substituted values (System.Net.WebUtility.HtmlEncode(System.String)). Set only when values are already trusted markup. |
input | Template text containing {{property}} or dotted {{path.to.Value}} tokens. |
model | Object or dictionary whose properties supply placeholder values. |
preserveMissingProperties | When , leave unmatched placeholders unchanged; when (default), replace them with empty string. |
Returns
The interpolated string.
Remarks
Use when the template may contain HTML or CSS. Double braces do not collide with CSS { rule } blocks, unlike single-brace Interpolate.
Name is industry shorthand for double-brace placeholders only — not full Mustache (no sections, partials, or #/^). Tokens must be tight: {{name}} matches; {{ name }} does not.
For plain messages with no markup, prefer Interpolate ({property}).