Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Workaround for U4-10345
using System;
using System.Collections.Generic;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
namespace YourNamespace
{
public class WrappedPublishedContent : IPublishedContent
{
public IEnumerable<IPublishedContent> ContentSet => _publishedContent.ContentSet;
public PublishedContentType ContentType => _publishedContent.ContentType;
public int Id { get; set; }
public int TemplateId => _publishedContent.TemplateId;
public int SortOrder => _publishedContent.SortOrder;
public string Name => _publishedContent.Name;
public string UrlName => _publishedContent.UrlName;
public string DocumentTypeAlias => _publishedContent.DocumentTypeAlias;
public int DocumentTypeId => _publishedContent.DocumentTypeId;
public string WriterName => _publishedContent.WriterName;
public string CreatorName => _publishedContent.CreatorName;
public int WriterId => _publishedContent.WriterId;
public int CreatorId => _publishedContent.CreatorId;
public string Path => _publishedContent.Path;
public DateTime CreateDate => _publishedContent.CreateDate;
public DateTime UpdateDate => _publishedContent.UpdateDate;
public Guid Version => _publishedContent.Version;
public int Level => _publishedContent.Level;
public string Url => _publishedContent.Url;
public PublishedItemType ItemType => _publishedContent.ItemType;
public bool IsDraft => _publishedContent.IsDraft;
public IPublishedContent Parent => _publishedContent.Parent;
public IEnumerable<IPublishedContent> Children => _publishedContent.Children;
public ICollection<IPublishedProperty> Properties => _publishedContent.Properties;
public object this[string alias] => _publishedContent[alias];
private readonly IPublishedContent _publishedContent;
public WrappedPublishedContent(IPublishedContent publishedContent)
{
_publishedContent = publishedContent;
}
public int GetIndex()
{
return _publishedContent.GetIndex();
}
public IPublishedProperty GetProperty(string alias)
{
return _publishedContent.GetProperty(alias);
}
public IPublishedProperty GetProperty(string alias, bool recurse)
{
return _publishedContent.GetProperty(alias, recurse);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.