Files
mixtape/zero.Core/Entities/ZeroEntity.cs
T

99 lines
2.3 KiB
C#
Raw Normal View History

2020-03-23 11:57:07 +01:00
using System;
using System.Diagnostics;
2020-03-24 23:09:29 +01:00
namespace zero.Core.Entities
2020-03-23 11:57:07 +01:00
{
2020-04-03 16:45:47 +02:00
[DebuggerDisplay("Id = {Id,nq}, Name = {Name}, Alias = {Alias}")]
public abstract class ZeroEntity : IZeroEntity
2020-03-24 20:30:03 +01:00
{
/// <inheritdoc/>
public string Id { get; set; }
/// <inheritdoc/>
public string Name { get; set; }
2020-04-03 16:45:47 +02:00
/// <inheritdoc/>
public string Alias { get; set; }
2020-03-24 20:30:03 +01:00
/// <inheritdoc/>
public uint Sort { get; set; }
/// <inheritdoc/>
public bool IsActive { get; set; }
2020-10-23 15:50:59 +02:00
/// <inheritdoc/>
public string Hash { get; set; }
/// <inheritdoc/>
2020-10-12 13:14:23 +02:00
public string LastModifiedById { get; set; }
2020-09-17 13:25:09 +02:00
/// <inheritdoc/>
public DateTimeOffset LastModifiedDate { get; set; }
/// <inheritdoc/>
2020-10-12 13:14:23 +02:00
public string CreatedById { get; set; }
2020-03-24 20:30:03 +01:00
/// <inheritdoc/>
public DateTimeOffset CreatedDate { get; set; }
2020-09-17 13:08:16 +02:00
/// <inheritdoc/>
2020-10-05 18:01:28 +02:00
public BlueprintConfiguration Blueprint { get; set; }
2020-03-24 20:30:03 +01:00
}
2020-11-14 12:34:26 +01:00
public interface IZeroEntity : IZeroIdEntity
2020-03-23 11:57:07 +01:00
{
/// <summary>
/// Full name of the entity
/// </summary>
2020-03-24 20:30:03 +01:00
string Name { get; set; }
2020-03-23 11:57:07 +01:00
2020-04-03 16:45:47 +02:00
/// <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; }
2020-03-23 11:57:07 +01:00
/// <summary>
/// Sort order
/// </summary>
2020-03-24 20:30:03 +01:00
uint Sort { get; set; }
2020-03-23 11:57:07 +01:00
/// <summary>
/// Whether the entity is visible in the frontend
/// </summary>
2020-03-24 20:30:03 +01:00
bool IsActive { get; set; }
2020-03-23 11:57:07 +01:00
2020-10-23 15:50:59 +02:00
/// <summary>
/// Unique hash for this entity (primarily used for routing)
/// </summary>
string Hash { get; set; }
/// <summary>
/// Backoffice user who last modified this content
/// </summary>
2020-10-12 13:14:23 +02:00
public string LastModifiedById { get; set; }
2020-09-17 13:25:09 +02:00
/// <summary>
/// Date of last modification
/// </summary>
DateTimeOffset LastModifiedDate { get; set; }
/// <summary>
/// Backoffice user who created this content
/// </summary>
2020-10-12 13:14:23 +02:00
[Overwrite]
public string CreatedById { get; set; }
2020-03-23 11:57:07 +01:00
/// <summary>
/// Date of creation
/// </summary>
2020-03-24 20:30:03 +01:00
DateTimeOffset CreatedDate { get; set; }
2020-09-17 13:08:16 +02:00
/// <summary>
2020-10-05 18:01:28 +02:00
/// Configuration of the base entity (which this one inherits from)
2020-09-17 13:08:16 +02:00
/// </summary>
2020-10-05 18:01:28 +02:00
BlueprintConfiguration Blueprint { get; set; }
2020-03-23 11:57:07 +01:00
}
}