Scriban takes a template, and a block of data, and merges it together with code.
Sample code
1 | var template = Template.Parse(GetTemplate()); |
Here is sample data
1 | var templateModel = new XmlTemplateModel |
Here is the template
1 | private static string GetTemplate() |
- Notice
- Header.InterfaceTypeId – on the template it’s That is all lowercase, capital lets have an underscore prefix.
- Loops
1
2
3{{~ for employee in employees ~}}
Is used to looup through objects
{{~ end ~}}
References
- https://github.com/scriban/scriban - GitHub - scriban/scriban: A fast, powerful, safe and lightweight scripting language and engine for .NET - Great documentation