Beispiel #1
0
        public static PathData EnsureDraft(IVersionManager versions, ContentVersionRepository versionRepository, string versionIndex, string versionKey, ContentItem item)
        {
            item = versionRepository.ParseVersion(versionIndex, versionKey, item)
                   ?? item;

            var page = Find.ClosestPage(item);

            if (!page.VersionOf.HasValue)
            {
                page = versions.GetOrCreateDraft(page);
                item = page.FindPartVersion(item);
            }

            return(new PathData(page, item));
        }