示例#1
0
        public async Task GenerateSchemaAsync(ISyncService sync)
        {
            await sync.WriteJsonSchemaAsync <RuleModel>(new FilePath("rule.json"));

            var sample = new RuleModel
            {
                Name    = "My-Rule",
                Trigger = new ContentChangedRuleTriggerDto
                {
                    HandleAll = true
                },
                TypedAction = new WebhookRuleActionDto
                {
                    Url = new Uri("https://squidex.io")
                },
                IsEnabled = true
            };

            await sync.WriteWithSchema(new FilePath("rules", "__rule.json"), sample, Ref);
        }
        public async Task GenerateSchemaAsync(DirectoryInfo directoryInfo, JsonHelper jsonHelper)
        {
            await jsonHelper.WriteJsonSchemaAsync <RuleModel>(directoryInfo, "rule.json");

            var sample = new RuleModel
            {
                Name    = "My-Rule",
                Trigger = new ContentChangedRuleTriggerDto
                {
                    HandleAll = true
                },
                TypedAction = new WebhookRuleActionDto
                {
                    Url = new Uri("https://squidex.io")
                },
                IsEnabled = true
            };

            await jsonHelper.WriteWithSchema(directoryInfo, "rules/__rule.json", sample, Ref);
        }
示例#3
0
 public static CreateExtendableRuleDto ToCreate(this RuleModel model)
 {
     return(SimpleMapper.Map(model, new CreateExtendableRuleDto()));
 }