public Task CheckUpdatedKeys(EngineObjectHookContext context) { if (context.UpdatedKeys.Contains("title")) { return(CheckTitle(context.TheObject)); } return(Task.FromResult(true)); }
public Task CheckTitle(EngineObjectHookContext context) { var title = context.TheObject.Get <string>("title"); // reset value for title if (title.Length > 20) { context.TheObject["title"] = title.Substring(0, 20); } // returning any value will be ok. return(Task.FromResult(true)); }