Owneat Technical Guide main Help

Class Entity

Namespace: Common.Primitives
Assembly: Common.dll

Common.Primitives.Entity defines an object that will be represented as a table in the database.

public abstract class Entity

Inheritance

object ← Entity

Derived

Allergen, Category, Customer, Feedback, FoodLabel, FormulaSection, Ingredient, Menu, OpeningHours, Order, OrderLineItem, Payment, Personalization, ProductBase, Restaurant, RestaurantEvent, Role, Table, TimeRange, User

Inherited Members

object.Equals\(object?\), object.Equals\(object?, object?\), object.GetHashCode\(\), object.GetType\(\), object.MemberwiseClone\(\), object.ReferenceEquals\(object?, object?\), object.ToString\(\)

Fields

DomainEvents

List of domain events that have been triggered by the Common.Primitives.Entity.

public readonly Queue<IDomainEvent> DomainEvents

Field Value

Queue < IDomainEvent \>

Properties

CreatedAt

System.DateTimeOffset for the creation date of the Common.Primitives.Entity.

public DateTimeOffset CreatedAt { get; set; }

Property Value

DateTimeOffset

Id

The Id property represents the unique identity of the Common.Primitives.Entity.

[Key] public Guid Id { get; init; }

Property Value

Guid

UpdatedAt

System.DateTimeOffset for the last update date of the Common.Primitives.Entity.

public DateTimeOffset UpdatedAt { get; set; }

Property Value

DateTimeOffset

Methods

EmitDomainEvent\(IDomainEvent\)

AddDomainEvent adds a domain event to the Common.Primitives.Entity to be dispatched when saving changes.

protected void EmitDomainEvent(IDomainEvent eventItem)

Parameters

eventItem IDomainEvent

Last modified: 21 May 2024