Ejemplo n.º 1
0
        public override async Task <IDisplayResult> UpdateAsync(ContentTypePartDefinition model, UpdateTypePartEditorContext context)
        {
            if (!string.Equals(nameof(BlockBodyPart), model.PartDefinition.Name, StringComparison.Ordinal))
            {
                return(null);
            }

            var settings = new BlockBodyPartSettings();

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

            context.Builder.WithSettings(settings);

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

            var model = new BlockBodyPartSettings();

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

            context.Builder.WithSettings(new BlockBodyPartSettings {
                LinkableContentTypes = model.LinkableContentTypes
            });

            return(Edit(contentTypePartDefinition));
        }