Table of Contents

Class EntityBase<TKey>

Namespace
Excalibur.Domain.Model
Assembly
Excalibur.Domain.dll

Provides a base class for entities with a specified key type.

public abstract class EntityBase<TKey> : IEntity<TKey>, IEntity, IEquatable<IEntity<TKey>>

Type Parameters

TKey

The type of the key used to uniquely identify the entity.

Inheritance
EntityBase<TKey>
Implements
IEntity<TKey>
Derived
Inherited Members

Remarks

This class implements IEntity<TKey> and provides equality comparison based on the key and type of the entity.

Constructors

EntityBase()

Initializes a new instance of the EntityBase<TKey> class.

protected EntityBase()

Properties

Key

Gets the key that uniquely identifies the entity.

public abstract TKey Key { get; }

Property Value

TKey

The key that uniquely identifies the entity.

Methods

Equals(IEntity<TKey>?)

Indicates whether the current object is equal to another object of the same type.

public virtual bool Equals(IEntity<TKey>? other)

Parameters

other IEntity<TKey>

An object to compare with this object.

Returns

bool

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

Equals(object?)

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

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

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

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.