Beispiel #1
0
        private Task BuildViewModel(TaxonomyMenuItemPartEditViewModel model, TaxonomyMenuItemPart part, ContentTypePartDefinition definition)
        {
            model.Name = part.Name;
            model.TaxonomyContentItemId = part.TaxonomyContentItemId;
            model.TaxonomyMenuItemPart  = part;

            model.TypePartDefinition = definition;

            return(Task.CompletedTask);
        }
Beispiel #2
0
        public override async Task <IDisplayResult> UpdateAsync(TaxonomyMenuItemPart part, IUpdateModel updater, UpdatePartEditorContext context)
        {
            var viewModel = new TaxonomyMenuItemPartEditViewModel();

            await updater.TryUpdateModelAsync(viewModel, Prefix, t => t.Name, t => t.TaxonomyContentItemId);

            part.Name = viewModel.Name;
            part.TaxonomyContentItemId = viewModel.TaxonomyContentItemId;


            return(Edit(part, context));
        }