コード例 #1
0
        public override IEnumerable<TemplateViewModel> TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.Name != "ApiPart")
                yield break;

            var settings = new ApiPartSettings
            {
                Enabled = "true"
            };

            if (updateModel.TryUpdateModel(settings, "ApiPartSettings", null, null))
            {
                settings.Build(builder);
            }

            yield return DefinitionTemplate(settings);
        }
コード例 #2
0
        public override IEnumerable <TemplateViewModel> TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.Name != "ApiPart")
            {
                yield break;
            }

            var settings = new ApiPartSettings
            {
                Enabled = "true"
            };

            if (updateModel.TryUpdateModel(settings, "ApiPartSettings", null, null))
            {
                settings.Build(builder);
            }

            yield return(DefinitionTemplate(settings));
        }