Exemplo n.º 1
0
        private static SaveNodeModel MapSitemapNodeModel(GetNodeResponse response, bool resetIds)
        {
            var model = new SaveNodeModel
            {
                Id       = resetIds ? default(Guid) : response.Data.Id,
                Version  = response.Data.Version,
                ParentId = response.Data.ParentId,
                PageId   = response.Data.PageId,
                UsePageTitleAsNodeTitle = response.Data.UsePageTitleAsNodeTitle,
                Title        = response.Data.NodeTitle,
                Url          = response.Data.NodeUrl,
                DisplayOrder = response.Data.DisplayOrder,
                Macro        = response.Data.Macro,
            };

            if (response.Translations != null)
            {
                model.Translations =
                    response.Translations.Select(
                        t =>
                        new SaveNodeTranslation
                {
                    Id      = t.Id,
                    Version = t.Version,
                    Title   = t.Title,
                    UsePageTitleAsNodeTitle = t.UsePageTitleAsNodeTitle,
                    Url        = t.Url,
                    Macro      = t.Macro,
                    LanguageId = t.LanguageId
                }).ToList();
            }

            return(model);
        }
Exemplo n.º 2
0
        private static SaveNodeModel MapCategoryNodeModel(GetNodeResponse response, bool resetIds)
        {
            var model = new SaveNodeModel
            {
                Id           = resetIds ? default(Guid) : response.Data.Id,
                Version      = response.Data.Version,
                ParentId     = response.Data.ParentId,
                Name         = response.Data.Name,
                DisplayOrder = response.Data.DisplayOrder,
                Macro        = response.Data.Macro,
            };

            return(model);
        }