Example of a template (using DoubleCurly syntax):
template.htm:
<table> {{foreach product in Products}} <tr><td>{{product.Name}}</td> {{if product.Stock > 0}} <td>In stock</td> {{else}} <td>Backordered</td> {{end}} </tr> {{end}} </table>
The code to parse and render the template:
var template = new TemplateParser<DoubleCurly>(); var data = new FlexContext(); data["Products"] = GetOrders(); // this funcion simply returns a list of order objects string renderedFile = template.RenderFile("template.htm" , data);