コード例 #1
0
        protected override DriverResult Editor(BlogArchivesPart part, dynamic shapeHelper)
        {
            var viewModel = new BlogArchivesViewModel {
                BlogId = part.BlogId,
                Blogs  = _blogService.Get().ToList().OrderBy(b => b.Name)
            };

            return(ContentShape("Parts_Blogs_BlogArchives_Edit",
                                () => shapeHelper.EditorTemplate(TemplateName: "Parts.Blogs.BlogArchives", Model: viewModel, Prefix: Prefix)));
        }
コード例 #2
0
        protected override DriverResult Editor(BlogArchivesPart part, IUpdateModel updater, dynamic shapeHelper)
        {
            var viewModel = new BlogArchivesViewModel();

            if (updater.TryUpdateModel(viewModel, Prefix, null, null))
            {
                part.BlogId = viewModel.BlogId;
            }

            return(Editor(part, shapeHelper));
        }