Пример #1
0
        public override async Task <IDisplayResult> UpdateAsync(ContentTypePartDefinition contentTypePartDefinition, UpdateTypePartEditorContext context)
        {
            var model    = new MarkdownBodyPartSettingsViewModel();
            var settings = new MarkdownBodyPartSettings();

            if (await context.Updater.TryUpdateModelAsync(model, Prefix))
            {
                settings.SanitizeHtml = model.SanitizeHtml;

                context.Builder.WithSettings(settings);
            }

            return(Edit(contentTypePartDefinition, context.Updater));
        }
        public override async Task <IDisplayResult> UpdateAsync(ContentTypePartDefinition contentTypePartDefinition, UpdateTypePartEditorContext context)
        {
            if (!String.Equals(nameof(MarkdownBodyPart), contentTypePartDefinition.PartDefinition.Name))
            {
                return(null);
            }

            var model = new MarkdownBodyPartSettings();

            await context.Updater.TryUpdateModelAsync(model, Prefix);

            context.Builder.WithSettings(model);

            return(Edit(contentTypePartDefinition, context.Updater));
        }