using Newtonsoft.Json; using System; using System.Diagnostics; namespace zero.Core.Entities { [DebuggerDisplay("Id = {Id,nq}, Name = {Name}, Alias = {Alias}")] public class ZeroEntity : ZeroIdEntity, IZeroDbConventions, IZeroRouteEntity { /// /// Full name of the entity /// public string Name { get; set; } /// /// Unique alias which can be used in the frontend and URLs /// public string Alias { get; set; } /// /// A key which can be used to query this entity in code /// public string Key { get; set; } /// /// Sort order /// public uint Sort { get; set; } /// /// Whether the entity is visible in the frontend /// public bool IsActive { get; set; } /// /// Unique hash for this entity (primarily used for routing) /// public string Hash { get; set; } /// /// Backoffice user who last modified this content /// public string LastModifiedById { get; set; } /// /// Date of last modification /// public DateTimeOffset LastModifiedDate { get; set; } /// /// Backoffice user who created this content /// public string CreatedById { get; set; } /// /// Date of creation /// public DateTimeOffset CreatedDate { get; set; } /// /// Configuration of the base entity (which this one inherits from) /// public BlueprintConfiguration Blueprint { get; set; } /// /// Language of the entity /// public string LanguageId { get; set; } /// /// [Warning] This field is always empty when bound to the database. /// It is only filled in the app-code for routing. /// [JsonIgnore] public string Url { get; set; } } public class ZeroIdEntity { /// /// Id of the entity /// public string Id { get; set; } } public interface IZeroRouteEntity { /// /// Id of the entity /// string Id { get; set; } /// /// Unique hash for this entity (primarily used for routing) /// string Hash { get; set; } } }