using System.Collections.Generic;
public static void Main()
var model = new PluginModel();
model.Customer = new Customer() { Name = "Jonathan", IsAdmin = true };
var context = new EvalContext();
context.MaxLoopIteration = 5;
context.RegisterDefaultAliasSafe();
context.RegisterType(typeof(PluginModel));
context.RegisterType(typeof(Customer));
context.RegisterType(typeof(TextBox));
context.Execute(ModelCustomization(), new { model });
FiddleHelper.Dump(model);
public static string ModelCustomization()
model.Title = $"AI Code Generator for {model.Customer.Name}";
model.TextBox1.Label = "Language / Software";
model.TextBox2.MaxLength = 50;
model.TextBox1.Label = "Description of the code to generate";
model.TextBox2.MaxLength = 5000;
if(model.Customer.IsAdmin)
model.TextBox1.MaxLength = int.MaxValue;
model.TextBox2.MaxLength = int.MaxValue;
public Customer Customer { get; set; }
public string Title { get; set; }
public string H1 { get; set; }
public TextBox TextBox1 { get; set; } = new TextBox();
public TextBox TextBox2 { get; set; } = new TextBox();
public string Name { get; set; }
public bool IsAdmin { get; set; }
public string Label { get; set; }
public int MaxLength { get; set; }