Removes the AdditionalData properties for EntitySlim and moves them to real properties of IDocumentEntitySlim, renames PublishedCultureInfos to not be plural

This commit is contained in:
Shannon
2018-05-08 12:43:07 +10:00
parent 85c739aed4
commit ee9f150483
18 changed files with 49 additions and 64 deletions

View File

@@ -15,6 +15,8 @@ namespace Umbraco.Core.Models.Entities
set => _cultureNames = value;
}
public ContentVariation Variations { get; set; }
/// <inheritdoc />
public bool Published { get; set; }

View File

@@ -25,18 +25,7 @@ namespace Umbraco.Core.Models.Entities
/// Gets an entity representing "root".
/// </summary>
public static readonly IEntitySlim Root = new EntitySlim { Path = "-1", Name = "root", HasChildren = true };
/// <summary>
/// Gets the AdditionalData key for culture names.
/// </summary>
public const string AdditionalCultureNames = "CultureNames";
/// <summary>
/// Gets the AdditionalData key for variations.
/// </summary>
public const string AdditionalVariations = "Variations";
// implement IEntity
/// <inheritdoc />

View File

@@ -10,6 +10,8 @@ namespace Umbraco.Core.Models.Entities
//fixme we need to supply more information than this and change this property name. This will need to include Published/Editor per variation since we need this information for the tree
IReadOnlyDictionary<string, string> CultureNames { get; }
ContentVariation Variations { get; }
/// <summary>
/// At least one variation is published
/// </summary>

View File

@@ -122,7 +122,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// <summary>
/// Gets culture infos for a culture.
/// </summary>
PublishedCultureInfos GetCulture(string culture = null);
PublishedCultureInfo GetCulture(string culture = null);
/// <summary>
/// Gets culture infos.
@@ -132,7 +132,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// the cultures that are published. For a draft content, those that are 'available' ie
/// have a non-empty content name.</para>
/// </remarks>
IReadOnlyDictionary<string, PublishedCultureInfos> Cultures { get; }
IReadOnlyDictionary<string, PublishedCultureInfo> Cultures { get; }
/// <summary>
/// Gets the type of the content item (document, media...).

View File

@@ -100,10 +100,10 @@ namespace Umbraco.Core.Models.PublishedContent
public virtual string GetUrl(string culture = null) => _content.GetUrl(culture);
/// <inheritdoc />
public PublishedCultureInfos GetCulture(string culture = null) => _content.GetCulture(culture);
public PublishedCultureInfo GetCulture(string culture = null) => _content.GetCulture(culture);
/// <inheritdoc />
public IReadOnlyDictionary<string, PublishedCultureInfos> Cultures => _content.Cultures;
public IReadOnlyDictionary<string, PublishedCultureInfo> Cultures => _content.Cultures;
/// <inheritdoc />
public virtual PublishedItemType ItemType => _content.ItemType;

View File

@@ -6,12 +6,12 @@ namespace Umbraco.Core.Models.PublishedContent
/// <summary>
/// Contains culture specific values for <see cref="IPublishedContent"/>.
/// </summary>
public class PublishedCultureInfos
public class PublishedCultureInfo
{
/// <summary>
/// Initializes a new instance of the <see cref="PublishedCultureInfos"/> class.
/// Initializes a new instance of the <see cref="PublishedCultureInfo"/> class.
/// </summary>
public PublishedCultureInfos(string culture, string name, DateTime date)
public PublishedCultureInfo(string culture, string name, DateTime date)
{
if (string.IsNullOrWhiteSpace(culture)) throw new ArgumentNullOrEmptyException(nameof(culture));
if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullOrEmptyException(nameof(name));