public ContentTreeNodeMetaInformationViewModel BuildViewModel(ContentTreeNodeMetaInformationInputModel contentTreeNodeMetaInformationInputModel)
 {
     return new ContentTreeNodeMetaInformationViewModel()
                {
                    ContentTreeNodeMetaInformationInputModel = contentTreeNodeMetaInformationInputModel
                };
 }
コード例 #2
0
        public virtual ActionResult ManageMetaInformation(ContentTreeNodeMetaInformationInputModel contentTreeNodeMetaInformationInputModel)
        {
            if (ModelState.IsValid)
            {
                var contentTreePageNode = contentTreePageNodeContext.GetAllContentTreePageNodes().Where(a => a.Id == contentTreeNodeMetaInformationInputModel.TreeNodeId && a.Action == contentTreeNodeMetaInformationInputModel.ContentItemId).FirstOrDefault();
                commandBus.Send(new ModifyPageMetaInformationCommand()
                                        {
                                            MetaDescription = contentTreeNodeMetaInformationInputModel.MetaDescription,
                                            MetaKeywords = contentTreeNodeMetaInformationInputModel.MetaKeywords,
                                            MetaTitle = contentTreeNodeMetaInformationInputModel.MetaTitle,
                                            TreeNodeId = contentTreeNodeMetaInformationInputModel.TreeNodeId,
                                            Action = contentTreeNodeMetaInformationInputModel.ContentItemId,
                                            AggregateRootId = new Guid(contentTreePageNode.PageId)
                                        });
                return new RedirectToRouteResult(new RouteValueDictionary(new Dictionary<string, object>()
                                                                              {
                                                                                  { "controller", typeof(ContentTreeNodeController).Name.Replace("Controller", string.Empty) },
                                                                                  { "action", "ManageMetaInformation" },
                                                                                  { "contentItemId", contentTreeNodeMetaInformationInputModel.ContentItemId },
                                                                                  { "TreeNodeId", contentTreeNodeMetaInformationInputModel.TreeNodeId}
                                                                              }));
            }

            return View("ManageMetaInformation", contentTreeNodeMetaInformationViewModelBuilder.BuildViewModel(contentTreeNodeMetaInformationInputModel));
        }