Merge remote-tracking branch 'origin/v9/dev' into v9/task/package-refactor

# Conflicts:
#	src/Umbraco.Core/Migrations/IMigration.cs
#	src/Umbraco.Core/Migrations/MigrationPlan.cs
#	src/Umbraco.Infrastructure/Migrations/IMigrationContext.cs
#	src/Umbraco.Infrastructure/Runtime/RuntimeState.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/MigrationTests.cs
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml
This commit is contained in:
Bjarke Berg
2021-06-29 14:23:08 +02:00
283 changed files with 6740 additions and 2365 deletions

View File

@@ -4,6 +4,7 @@ using Umbraco.Cms.Core.Models.Entities;
namespace Umbraco.Cms.Core.Models
{
/// <summary>
/// Provides a base class for content items.
/// </summary>

View File

@@ -0,0 +1,72 @@
using System;
namespace Umbraco.Cms.Core.Models
{
public interface IReadOnlyContentBase
{
/// <summary>
/// Gets the integer identifier of the entity.
/// </summary>
int Id { get; }
/// <summary>
/// Gets the Guid unique identifier of the entity.
/// </summary>
Guid Key { get; }
/// <summary>
/// Gets the creation date.
/// </summary>
DateTime CreateDate { get; }
/// <summary>
/// Gets the last update date.
/// </summary>
DateTime UpdateDate { get; }
/// <summary>
/// Gets the name of the entity.
/// </summary>
string Name { get; }
/// <summary>
/// Gets the identifier of the user who created this entity.
/// </summary>
int CreatorId { get; }
/// <summary>
/// Gets the identifier of the parent entity.
/// </summary>
int ParentId { get; }
/// <summary>
/// Gets the level of the entity.
/// </summary>
int Level { get; }
/// <summary>
/// Gets the path to the entity.
/// </summary>
string Path { get; }
/// <summary>
/// Gets the sort order of the entity.
/// </summary>
int SortOrder { get; }
/// <summary>
/// Gets the content type id
/// </summary>
int ContentTypeId { get; }
/// <summary>
/// Gets the identifier of the writer.
/// </summary>
int WriterId { get; }
/// <summary>
/// Gets the version identifier.
/// </summary>
int VersionId { get; }
}
}

View File

@@ -0,0 +1,42 @@
using System;
namespace Umbraco.Cms.Core.Models
{
public struct ReadOnlyContentBaseAdapter : IReadOnlyContentBase
{
private readonly IContentBase _content;
private ReadOnlyContentBaseAdapter(IContentBase content)
{
_content = content ?? throw new ArgumentNullException(nameof(content));
}
public static ReadOnlyContentBaseAdapter Create(IContentBase content) => new ReadOnlyContentBaseAdapter(content);
public int Id => _content.Id;
public Guid Key => _content.Key;
public DateTime CreateDate => _content.CreateDate;
public DateTime UpdateDate => _content.UpdateDate;
public string Name => _content.Name;
public int CreatorId => _content.CreatorId;
public int ParentId => _content.ParentId;
public int Level => _content.Level;
public string Path => _content.Path;
public int SortOrder => _content.SortOrder;
public int ContentTypeId => _content.ContentTypeId;
public int WriterId => _content.WriterId;
public int VersionId => _content.VersionId;
}
}