I try to write a Handlebar.Net helper which works like Equals. The Helper should be used like
{{#eq name "Foo"}}
true
{{else}}
false
{{/eq}}
But I don´t know how to implement this helper. In JS there is this example but I can´t find an example for C#.
My first shot was:
Handlebars.RegisterHelper("#eq", (output, context, data) =>
{
if (data.Length != 2)
output.WriteSafeString("false");
output.WriteSafeString(data[0].Equals(data[1]));
});
But this just writes True or False into my file.
I´ve found the solution: