Created
August 22, 2017 18:32
-
-
Save LennardF1989/aec5476f269b30e788d4169459300734 to your computer and use it in GitHub Desktop.
Workaround for U4-10345
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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