Example #1
0
 /// <summary>
 /// Initializes a new instance of <see cref="TemplateContext"/>.
 /// </summary>
 /// <param name="model">The model.</param>
 /// <param name="options">The template options.</param>
 /// <param name="allowModelMembers">Whether the members of the model can be accessed by default.</param>
 public TemplateContext(object model, TemplateOptions options, bool allowModelMembers = true) : this(options)
 {
     Model             = model ?? throw new ArgumentNullException(nameof(model));
     AllowModelMembers = allowModelMembers;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of <see cref="TemplateContext"/>.
 /// </summary>
 public TemplateContext(object model, TemplateOptions options) : this(options)
 {
     Model = model ?? throw new ArgumentNullException(nameof(model));
 }