I am using DotLiquid template engine and trying access dictionary value in template. I have passed to template this drop:
public class SomeDrop : Drop
{
public Dictionary<string, object> MyDictionary {get; set;}
}
var someDropInstance = SomeDrop
{
MyDictionary = new Dictionary<string, object> {{"myKey", 1}}
}
Template.NamingConvention = new CSharpNamingConvention();
var preparedTemplate = Template.Parse(template);
var templateOutput = preparedTemplate.Render(Hash.FromAnonymousObject(new { @this = someDropInstance }));
In template i can't access to myKey value as
{{ this.MyDictionary.myKey }}
neither as
{{ this.MyDictionary['myKey'] }}