This is a question about the safety of Liquid, with the DotLiquid library.
Suppose my view model is something like following (pseudocode):
class MyViewModel
public string MyField
public string MyMethod()
...and a MyViewModel object is passed to the Liquid template, where MyField is set to be accessible from within the template (so the template can read its content).
My assumption is that the answer is no to all of the questions but I'd like to be sure.
Thank you.
MyField
can't be assigned to. In fact, it can't be accessed at all - only public instance methods and properties are accessible in DotLiquid.Drop
class, then all public instance methods and properties will be accessible.Drop
, then you'll probably be using the Template.RegisterSafeType(Type type, string[] allowedMembers)
method, which requires you to tell DotLiquid which properties and methods can be accessed (using the allowedMembers
parameter).