Closed pranavdhundhia closed 5 years ago
` ITemplateContext ctx = new TemplateContext();
List
ctx.DefineLocalVariable("context", ProductList.ToLiquid());`
ctx.DefineLocalVariable("context", ProductList.ToLiquid());
Use using Liquid.NET.Utils;
ITemplateContext ctx = new TemplateContext(); List<Orders> ProductList = new List<Orders> { new Orders {OrderId = 1,ProductName="Some name",Quantity =30}, new Orders {OrderId = 1,ProductName="Some name1",Quantity =30}, new Orders {OrderId = 1,ProductName="Some name2",Quantity =30} }; ctx.DefineLocalVariable("context", new LiquidCollection(ProductList));
Define Liquid Collection with List throws error. Is it possible to define T type generic collection as ITemplateContext-> LocalVariable