These block helpers use System.Linq.Dynamic.Core.
A breaking change is introduced which is related to System.Linq.Dynamic.Core DynamicLinq (CVE).
The NuGet Handlebars.Net.Helpers.DynamicLinq will not be loaded automatically anymore. You need to allow this via the configuration. In addition, an extra configuration setting is added to allow the use of ToString
and Equals
on an object
.
Example:
var handlebarsContext = HandlebarsDotNet.Handlebars.Create(); HandlebarsHelpers.Register(handlebarsContext, o => { o.DynamicLinqHelperOptions = new HandlebarsDynamicLinqHelperOptions { Allow = true, AllowEqualsAndToStringMethodsOnObject = true }; });Summary Execute an expression Returns Result from the expression Parameters expression The dynamic expression to execute
Context N/A
Usage
Returns
Summary Execute an dynamic expression on an object Returns Result from the expression Parameters object The source object expression The dynamic expression to executeContext
{ "modifyDate": "2012-04-23T18:25:43.511Z" }
Usage
{{Expression modifyDate 'AddYears(1)'}}
or
{{Linq modifyDate 'AddYears(1)'}}
Returns
Returns Returns the first element of a sequence, or a default value if no element is found. Parameters object The source object expression The dynamic linq predicate (optional)Context
{ "data": [ "stef", "test", "other" ] }
Usage
{{DynamicLinq.FirstOrDefault data 'Contains("e")'}}
Returns
Returns Filters a sequence of values based on a predicate. Parameters object The source object expression The dynamic linq predicate (optional)Context
{ "data": [ "stef", "test", "other" ] }
Usage
{{DynamicLinq.Where data 'Contains("e")'}}
Returns
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4