Skip to content

Latest commit

 

History

History
110 lines (68 loc) · 3.54 KB

Sagara.Core.Data.Models.Entity.md

File metadata and controls

110 lines (68 loc) · 3.54 KB

Entity Class

Abstract base class for all EF Core entities. It contains common audit properties and the
timestamp property.

Derive from this class and add an Id property with the desired Id type.

public abstract class Entity :
Sagara.Core.Data.Models.IEntity

Inheritance System.Object 🡒 Entity

Derived
GuidIdEntity

Implements IEntity

Constructors

Entity() Constructor

Default .ctor. Initializes the Id and sets CreateUtc and UpdateUtc
to the current UTC date/time.

public Entity();

Properties

Entity.CreateUserId Property

UserId of the person who created the entity.

public System.Guid CreateUserId { get; set; }

Implements CreateUserId

Property Value

System.Guid

Entity.CreateUtc Property

UTC date/time when the entity was created.

public System.DateTime CreateUtc { get; set; }

Implements CreateUtc

Property Value

System.DateTime

Entity.Timestamp Property

SQL Server timestamp field, used for concurrency checking.

public byte[] Timestamp { get; set; }

Implements Timestamp

Property Value

System.Byte[]

Entity.UpdateUserId Property

UserId of the person who last updated the entity.

public System.Guid UpdateUserId { get; set; }

Implements UpdateUserId

Property Value

System.Guid

Entity.UpdateUtc Property

UTC date/time when the entity was last updated.

public System.DateTime UpdateUtc { get; set; }

Implements UpdateUtc

Property Value

System.DateTime