Innovt Platform
Search Results for

    Show / Hide Table of Contents

    Class Entity

    Represents an abstract base class for entities in the domain model.

    Inheritance
    object
    Entity
    Entity<T>
    AuthUser
    BaseUser
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Innovt.Domain.Core.Model
    Assembly: Innovt.Domain.Core.dll
    Syntax
    public abstract class Entity

    Constructors

    | Edit this page View Source

    Entity()

    Initializes a new instance of the Entity class.

    Declaration
    protected Entity()
    | Edit this page View Source

    Entity(int)

    Initializes a new instance of the Entity class with a specific identifier.

    Declaration
    protected Entity(int id)
    Parameters
    Type Name Description
    int id

    The identifier for the entity.

    Properties

    | Edit this page View Source

    CreatedAt

    Gets or sets the date and time when the entity was created.

    Declaration
    public DateTimeOffset CreatedAt { get; set; }
    Property Value
    Type Description
    DateTimeOffset
    | Edit this page View Source

    Id

    Gets or sets the unique identifier for the entity.

    Declaration
    public virtual int Id { get; set; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    UpdatedAt

    Gets or sets the date and time when the entity was last updated.

    Declaration
    public DateTimeOffset UpdatedAt { get; set; }
    Property Value
    Type Description
    DateTimeOffset

    Methods

    | Edit this page View Source

    AddDomainEvent(DomainEvent)

    Adds a domain event to the entity.

    Declaration
    public Entity AddDomainEvent(DomainEvent domainEvent)
    Parameters
    Type Name Description
    DomainEvent domainEvent

    The domain event to add.

    Returns
    Type Description
    Entity
    | Edit this page View Source

    Equals(object?)

    Determines whether the specified object is equal to the current object.

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current object.

    Returns
    Type Description
    bool

    true if the specified object is equal to the current object; otherwise, false.

    Overrides
    object.Equals(object)
    | Edit this page View Source

    GetDomainEvents()

    Gets the list of unprocessed domain events associated with the entity.

    Declaration
    public IReadOnlyList<DomainEvent> GetDomainEvents()
    Returns
    Type Description
    IReadOnlyList<DomainEvent>

    A read-only list of unprocessed domain events.

    | Edit this page View Source

    GetHashCode()

    Serves as the default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current object.

    Overrides
    object.GetHashCode()
    | Edit this page View Source

    IsNew()

    Checks if the entity is new (i.e., not persisted in the database yet).

    Declaration
    public bool IsNew()
    Returns
    Type Description
    bool

    true if the entity is new; otherwise, false.

    | Edit this page View Source

    SetAsNew()

    Declaration
    public Entity SetAsNew()
    Returns
    Type Description
    Entity

    Extension Methods

    Extensions.IsNull(object)
    Extensions.ToStringOrDefault(object)
    SimpleMapper.MapTo<T1>(object)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX