99 lines
2.3 KiB
C#
99 lines
2.3 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
|
|
namespace zero.Core.Entities
|
|
{
|
|
[DebuggerDisplay("Id = {Id,nq}, Name = {Name}, Alias = {Alias}")]
|
|
public abstract class ZeroEntity : IZeroEntity
|
|
{
|
|
/// <inheritdoc/>
|
|
public string Id { get; set; }
|
|
|
|
/// <inheritdoc/>
|
|
public string Name { get; set; }
|
|
|
|
/// <inheritdoc/>
|
|
public string Alias { get; set; }
|
|
|
|
/// <inheritdoc/>
|
|
public uint Sort { get; set; }
|
|
|
|
/// <inheritdoc/>
|
|
public bool IsActive { get; set; }
|
|
|
|
/// <inheritdoc/>
|
|
public string Hash { get; set; }
|
|
|
|
/// <inheritdoc/>
|
|
public string LastModifiedById { get; set; }
|
|
|
|
/// <inheritdoc/>
|
|
public DateTimeOffset LastModifiedDate { get; set; }
|
|
|
|
/// <inheritdoc/>
|
|
public string CreatedById { get; set; }
|
|
|
|
/// <inheritdoc/>
|
|
public DateTimeOffset CreatedDate { get; set; }
|
|
|
|
/// <inheritdoc/>
|
|
public BlueprintConfiguration Blueprint { get; set; }
|
|
}
|
|
|
|
|
|
public interface IZeroEntity : IZeroIdEntity
|
|
{
|
|
/// <summary>
|
|
/// Full name of the entity
|
|
/// </summary>
|
|
string Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// Unique alias which can be used in the frontend and URLs
|
|
/// As generating aliases from the name would not be unique we append an incremental number if the desired alias is not available anymore
|
|
/// </summary>
|
|
string Alias { get; set; }
|
|
|
|
/// <summary>
|
|
/// Sort order
|
|
/// </summary>
|
|
uint Sort { get; set; }
|
|
|
|
/// <summary>
|
|
/// Whether the entity is visible in the frontend
|
|
/// </summary>
|
|
bool IsActive { get; set; }
|
|
|
|
/// <summary>
|
|
/// Unique hash for this entity (primarily used for routing)
|
|
/// </summary>
|
|
string Hash { get; set; }
|
|
|
|
/// <summary>
|
|
/// Backoffice user who last modified this content
|
|
/// </summary>
|
|
public string LastModifiedById { get; set; }
|
|
|
|
/// <summary>
|
|
/// Date of last modification
|
|
/// </summary>
|
|
DateTimeOffset LastModifiedDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// Backoffice user who created this content
|
|
/// </summary>
|
|
[Overwrite]
|
|
public string CreatedById { get; set; }
|
|
|
|
/// <summary>
|
|
/// Date of creation
|
|
/// </summary>
|
|
DateTimeOffset CreatedDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// Configuration of the base entity (which this one inherits from)
|
|
/// </summary>
|
|
BlueprintConfiguration Blueprint { get; set; }
|
|
}
|
|
}
|