Originally Requested by @Tasteful in #16
It could be useful to chain helper methods together before rendering. If we look at languages such as liquid we chain them together like {{ helper1 arg | helper2 }} with the results of helper1 going into the arguments of helper2.
Handlebars has a similar functionality with helpers by nesting the helper declarations like so: {{ helper1 (helper2 arg) }}
Currently this functionality can be simulated by nesting functions in your helper like so
var helpers = new Helpers()
.Register<decimal>("FormatCurrencyAndQuote", (context, count) =>
{
return Quote(FormatCurrency(count))
});
string FormatCurrency(decimal value) => count.ToString("C", new CultureInfo("en-GB"));
string Quote(string value) => $"\"{value}\"";
If you think this functionality would be useful please leave as 👍 or ❤️ and comment if you have a preference on synax
Originally Requested by @Tasteful in #16
It could be useful to chain helper methods together before rendering. If we look at languages such as liquid we chain them together like
{{ helper1 arg | helper2 }}with the results of helper1 going into the arguments of helper2.Handlebars has a similar functionality with helpers by nesting the helper declarations like so:
{{ helper1 (helper2 arg) }}Currently this functionality can be simulated by nesting functions in your helper like so
If you think this functionality would be useful please leave as 👍 or ❤️ and comment if you have a preference on synax