DotLiquid.Mailer.Core by MiSeeger

<PackageReference Include="DotLiquid.Mailer.Core" Version="1.0.0" />

 LiquidFunctions

public static class LiquidFunctions
using System; using System.Linq; using System.Reflection; namespace DotLiquid.Mailer.Core { public static class LiquidFunctions { public static void RegisterViewModel(Type rootType) { (from t in rootType.Assembly.GetTypes() where t.Namespace == rootType.Namespace select t).ToList().ForEach(RegisterSafeTypeWithAllProperties); } private static void RegisterSafeTypeWithAllProperties(Type type) { Template.RegisterSafeType(type, (from p in type.GetProperties() select p.Name).ToArray()); } public static string RenderViewModel(this Template template, object root) { return template.Render(Hash.FromAnonymousObject(root, false), (IFormatProvider)null); } } }