using System; using System.ComponentModel.DataAnnotations.Schema; using Abp.Timing; namespace Abp.Domain.Entities.Auditing { /// /// A shortcut of for most used primary key type (). /// [Serializable] public abstract class CreationAuditedAggregateRoot : CreationAuditedAggregateRoot { } /// /// This class can be used to simplify implementing for aggregate roots. /// /// Type of the primary key of the entity [Serializable] public abstract class CreationAuditedAggregateRoot : AggregateRoot, ICreationAudited { /// /// Creation time of this entity. /// public virtual DateTime CreationTime { get; set; } /// /// Creator of this entity. /// public virtual long? CreatorUserId { get; set; } /// /// Constructor. /// protected CreationAuditedAggregateRoot() { CreationTime = Clock.Now; } } /// /// This class can be used to simplify implementing for aggregate roots. /// /// Type of the primary key of the entity /// Type of the user [Serializable] public abstract class CreationAuditedAggregateRoot : CreationAuditedAggregateRoot, ICreationAudited where TUser : IEntity { /// /// Reference to the creator user of this entity. /// [ForeignKey("CreatorUserId")] public virtual TUser CreatorUser { get; set; } } }