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

74 lines
1.7 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; }
/// <inheritdoc/>
public string LastModifiedById { get; set; }
/// <inheritdoc/>
public string CreatedById { get; set; }
2020-03-24 20:30:03 +01:00
/// <inheritdoc/>
public DateTimeOffset CreatedDate { get; set; }
}
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
/// <summary>
/// Backoffice user who last modified this content
/// </summary>
public string LastModifiedById { get; set; }
/// <summary>
/// Backoffice user who created this content
/// </summary>
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-03-23 11:57:07 +01:00
}
}