using System.Collections.Generic;
public string testvar1 {get; set;}
public string testvar2 {get; set;}
public static void Main()
var test = new { another = 1};
var scriptObject1 = new ScriptObject();
scriptObject1.Add("var1", "Variable 1");
Dictionary<string, object> x = new Dictionary<string, object>();
x.Add("fromTest", new Test(){testvar1 = "something1", testvar2 = "something2"});
var context = new TemplateContext();
foreach(KeyValuePair<string, object> y in x){
scriptObject1.Add(y.Key, y.Value);
context.PushGlobal(scriptObject1);
string templateString = "This is var1: `{{var1}}` and this is var one: `{{another}}` and fromTest: `{{fromTest.testvar2}}`";
var template = Template.Parse(templateString);
var result = template.Render(context);
Console.WriteLine(result);