class
AggregateRoot<TId>
Ensamblado: EricksonLopez.SharedKernelpublic abstract class AggregateRoot<TId> : Entity<TId>, IAggregateRoot where TId : notnull, IEquatable<TId>
Hereda de: Entity<TId>Implementa: IAggregateRoot
Represents an abstract base class for aggregate roots that define transactional consistency boundaries in Domain-Driven Design.
Miembros (5)
methodClearDomainEvents
public void ClearDomainEvents()
Clears all pending domain events recorded by this aggregate root.
methodDrainDomainEvents
public IReadOnlyList<IDomainEvent> DrainDomainEvents()
Transfers and clears all pending domain events recorded by this aggregate root.
Retorna: A read-only collection of pending domain events in emission order, or an empty collection if no events were recorded.
methodRequeueDomainEvents
public void RequeueDomainEvents(IEnumerable<IDomainEvent> events)
Re-queues previously drained domain events back into this aggregate root, typically used during transactional rollback.
- events: IEnumerable<IDomainEvent>
- The domain events to restore.
propertyDomainEvents
public IReadOnlyList<IDomainEvent> DomainEvents { get; }
Gets a read-only view of pending domain events recorded by this aggregate root without clearing them. Returns an immutable snapshot list to prevent concurrent modification exceptions during enumeration.
propertyPendingDomainEventsCount
public int PendingDomainEventsCount { get; }
Gets the count of pending domain events recorded by this aggregate root without allocating a snapshot list.
class
AuditableAggregateRoot<TId>
Ensamblado: EricksonLopez.SharedKernelpublic abstract class AuditableAggregateRoot<TId> : AggregateRoot<TId>, IAuditableEntity where TId : notnull, IEquatable<TId>
Hereda de: AggregateRoot<TId>Implementa: IAuditableEntity
Represents an abstract base class for aggregate roots that track temporal and actor audit metadata.
Miembros (16)
methodMarkAsDeleted
public void MarkAsDeleted(Guid deletedBy, DateTimeOffset deletedAt)
Marks the aggregate root as soft-deleted with a GUID actor identifier and timestamp.
- deletedBy: Guid
- The deleter user GUID.
- deletedAt: DateTimeOffset
- The deletion timestamp.
methodMarkAsDeleted
public void MarkAsDeleted(string? deletedBy, DateTimeOffset deletedAt)
Marks the aggregate root as soft-deleted with the specified actor and timestamp.
- deletedBy: string?
- The deleter identifier.
- deletedAt: DateTimeOffset
- The deletion timestamp.
methodMarkAsUpdated
public void MarkAsUpdated(Guid updatedBy, DateTimeOffset updatedAt)
Marks the aggregate root as updated with a GUID actor identifier and timestamp.
- updatedBy: Guid
- The modifier user GUID.
- updatedAt: DateTimeOffset
- The modification timestamp.
methodMarkAsUpdated
public void MarkAsUpdated(string? updatedBy, DateTimeOffset updatedAt)
Marks the aggregate root as updated with the specified actor and timestamp.
- updatedBy: string?
- The modifier identifier.
- updatedAt: DateTimeOffset
- The modification timestamp.
methodSetCreated
public void SetCreated(DateTimeOffset createdAt, string? createdBy = null)
Sets the creation audit metadata for this aggregate root.
- createdAt: DateTimeOffset
- The timestamp when the aggregate root was created.
- createdBy: string?
- The optional user or system identifier that created the aggregate root.
methodSetDeleted
public void SetDeleted(DateTimeOffset deletedAt, string? deletedBy = null)
Sets the soft-deletion audit metadata for this aggregate root.
- deletedAt: DateTimeOffset
- The timestamp when the aggregate root was deleted.
- deletedBy: string?
- The optional user or system identifier that deleted the aggregate root.
methodSetModified
public void SetModified(DateTimeOffset lastModifiedAt, string? lastModifiedBy = null)
Sets the modification audit metadata for this aggregate root.
- lastModifiedAt: DateTimeOffset
- The timestamp when the aggregate root was modified.
- lastModifiedBy: string?
- The optional user or system identifier that modified the aggregate root.
propertyCreatedAt
public DateTimeOffset CreatedAt { get; protected set; }
Gets the date and time when the entity was created.
propertyCreatedBy
public string? CreatedBy { get; protected set; }
Gets the optional actor or user identifier that created the entity.
propertyDeletedAt
public DateTimeOffset? DeletedAt { get; protected set; }
Gets the date and time when the aggregate root was soft-deleted, if applicable.
propertyDeletedBy
public string? DeletedBy { get; protected set; }
Gets the optional actor or user identifier that soft-deleted the aggregate root, if applicable.
propertyIsDeleted
public bool IsDeleted { get; }
Gets a value indicating whether the aggregate root has been soft-deleted.
propertyLastModifiedAt
public DateTimeOffset? LastModifiedAt { get; protected set; }
Gets the date and time when the entity was last modified, if any.
propertyLastModifiedBy
public string? LastModifiedBy { get; protected set; }
Gets the optional actor or user identifier that last modified the entity, if any.
propertyUpdatedAt
public DateTimeOffset? UpdatedAt { get; }
Gets the date and time when the aggregate root was last modified (alias for `LastModifiedAt`).
propertyUpdatedBy
public string? UpdatedBy { get; }
Gets the optional actor or user identifier that last modified the aggregate root (alias for `LastModifiedBy`).
class
AuditableEntity<TId>
Ensamblado: EricksonLopez.SharedKernelpublic abstract class AuditableEntity<TId> : Entity<TId>, IAuditableEntity where TId : notnull, IEquatable<TId>
Hereda de: Entity<TId>Implementa: IAuditableEntity
Represents an abstract base class for domain entities that track temporal and actor audit metadata.
Miembros (16)
methodMarkAsDeleted
public void MarkAsDeleted(Guid deletedBy, DateTimeOffset deletedAt)
Marks the entity as soft-deleted with a GUID actor identifier and timestamp.
- deletedBy: Guid
- The deleter user GUID.
- deletedAt: DateTimeOffset
- The deletion timestamp.
methodMarkAsDeleted
public void MarkAsDeleted(string? deletedBy, DateTimeOffset deletedAt)
Marks the entity as soft-deleted with the specified actor and timestamp.
- deletedBy: string?
- The deleter identifier.
- deletedAt: DateTimeOffset
- The deletion timestamp.
methodMarkAsUpdated
public void MarkAsUpdated(Guid updatedBy, DateTimeOffset updatedAt)
Marks the entity as updated with a GUID actor identifier and timestamp.
- updatedBy: Guid
- The modifier user GUID.
- updatedAt: DateTimeOffset
- The modification timestamp.
methodMarkAsUpdated
public void MarkAsUpdated(string? updatedBy, DateTimeOffset updatedAt)
Marks the entity as updated with the specified actor and timestamp.
- updatedBy: string?
- The modifier identifier.
- updatedAt: DateTimeOffset
- The modification timestamp.
methodSetCreated
public void SetCreated(DateTimeOffset createdAt, string? createdBy = null)
Sets the creation audit metadata for this entity.
- createdAt: DateTimeOffset
- The timestamp when the entity was created.
- createdBy: string?
- The optional user or system identifier that created the entity.
methodSetDeleted
public void SetDeleted(DateTimeOffset deletedAt, string? deletedBy = null)
Sets the soft-deletion audit metadata for this entity.
- deletedAt: DateTimeOffset
- The timestamp when the entity was deleted.
- deletedBy: string?
- The optional user or system identifier that deleted the entity.
methodSetModified
public void SetModified(DateTimeOffset lastModifiedAt, string? lastModifiedBy = null)
Sets the modification audit metadata for this entity.
- lastModifiedAt: DateTimeOffset
- The timestamp when the entity was modified.
- lastModifiedBy: string?
- The optional user or system identifier that modified the entity.
propertyCreatedAt
public DateTimeOffset CreatedAt { get; protected set; }
Gets the date and time when the entity was created.
propertyCreatedBy
public string? CreatedBy { get; protected set; }
Gets the optional actor or user identifier that created the entity.
propertyDeletedAt
public DateTimeOffset? DeletedAt { get; protected set; }
Gets the date and time when the entity was soft-deleted, if applicable.
propertyDeletedBy
public string? DeletedBy { get; protected set; }
Gets the optional actor or user identifier that soft-deleted the entity, if applicable.
propertyIsDeleted
public bool IsDeleted { get; }
Gets a value indicating whether the entity has been soft-deleted.
propertyLastModifiedAt
public DateTimeOffset? LastModifiedAt { get; protected set; }
Gets the date and time when the entity was last modified, if any.
propertyLastModifiedBy
public string? LastModifiedBy { get; protected set; }
Gets the optional actor or user identifier that last modified the entity, if any.
propertyUpdatedAt
public DateTimeOffset? UpdatedAt { get; }
Gets the date and time when the entity was last modified (alias for `LastModifiedAt`).
propertyUpdatedBy
public string? UpdatedBy { get; }
Gets the optional actor or user identifier that last modified the entity (alias for `LastModifiedBy`).
record
DomainEvent
Ensamblado: EricksonLopez.SharedKernelpublic abstract record DomainEvent : IDomainEvent
Implementa: IDomainEvent
Represents an abstract base record for immutable domain events.
Miembros (4)
propertyEventId
public Guid EventId { get; }
Gets the underlying GUID value of the domain event identifier.
propertyId
public EventId Id { get; }
Gets the unique, time-ordered identifier of the domain event.
propertyOccurredAt
public DateTimeOffset OccurredAt { get; }
Gets the UTC timestamp at which the domain event occurred.
propertyOccurredOn
public DateTimeOffset OccurredOn { get; }
Gets the UTC occurrence timestamp as an alias for `OccurredAt`.
class
DomainEventIdentityEqualityComparer
Ensamblado: EricksonLopez.SharedKernelpublic sealed class DomainEventIdentityEqualityComparer : IEqualityComparer<IDomainEvent>, IEqualityComparer<DomainEvent>
Implementa: IEqualityComparer<DomainEvent>, IEqualityComparer<IDomainEvent>
Provides equality comparison for domain events based strictly on their unique identifier (`DomainEvent.Id`).
Miembros (5)
methodEquals
public bool Equals(DomainEvent? x, DomainEvent? y)
Inherits documentation from base type or interface.
- x: DomainEvent?
- y: DomainEvent?
methodEquals
public bool Equals(IDomainEvent? x, IDomainEvent? y)
Inherits documentation from base type or interface.
- x: IDomainEvent?
- y: IDomainEvent?
methodGetHashCode
public int GetHashCode(DomainEvent obj)
Inherits documentation from base type or interface.
- obj: DomainEvent
methodGetHashCode
public int GetHashCode(IDomainEvent obj)
Inherits documentation from base type or interface.
- obj: IDomainEvent
propertyInstance
public static DomainEventIdentityEqualityComparer Instance { get; }
Gets the singleton instance of the `DomainEventIdentityEqualityComparer`.
class
Entity<TId>
Ensamblado: EricksonLopez.SharedKernelpublic abstract class Entity<TId> : IEntity<TId>, IEquatable<Entity<TId>> where TId : notnull, IEquatable<TId>
Implementa: IEntity<TId>, IEquatable<Entity<TId>>
Represents an abstract base class for domain entities whose equality is determined by runtime type and identity.
Miembros (6)
methodEquals
public virtual bool Equals(Entity<TId>? other)
Inherits documentation from base type or interface.
- other: Entity<TId>?
methodEquals
public override bool Equals(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodGetHashCode
public override int GetHashCode()
Inherits documentation from base type or interface.
methodoperator !=
public static bool operator !=(Entity<TId>? left, Entity<TId>? right)
Determines whether two entity instances are not equal.
- left: Entity<TId>?
- The first entity to compare.
- right: Entity<TId>?
- The second entity to compare.
Retorna: `true` if the entities are not equal; otherwise, `false`.
methodoperator ==
public static bool operator ==(Entity<TId>? left, Entity<TId>? right)
Determines whether two entity instances are equal based on their runtime type and identity.
- left: Entity<TId>?
- The first entity to compare.
- right: Entity<TId>?
- The second entity to compare.
Retorna: `true` if both entities are equal; otherwise, `false`.
propertyId
public TId Id { get; protected init; }
Gets the unique identifier of the entity.
interface
IAggregateRoot
Ensamblado: EricksonLopez.SharedKernelpublic interface IAggregateRoot : IHasDomainEvents
Implementa: IHasDomainEvents
Defines an aggregate root that acts as the transactional consistency boundary of a domain model.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
interface
IAuditableEntity
Ensamblado: EricksonLopez.SharedKernelpublic interface IAuditableEntity
Defines temporal and actor audit metadata for entities and aggregate roots.
Miembros (4)
propertyCreatedAt
DateTimeOffset CreatedAt { get; }
Gets the date and time when the entity was created.
propertyCreatedBy
string? CreatedBy { get; }
Gets the optional actor or user identifier that created the entity.
propertyLastModifiedAt
DateTimeOffset? LastModifiedAt { get; }
Gets the date and time when the entity was last modified, if any.
propertyLastModifiedBy
string? LastModifiedBy { get; }
Gets the optional actor or user identifier that last modified the entity, if any.
interface
IDomainEventDispatcher
Ensamblado: EricksonLopez.SharedKernelpublic interface IDomainEventDispatcher
Defines the contract for dispatching domain events collected from domain entities.
Miembros (2)
methodDispatch
void Dispatch(IReadOnlyList<IDomainEvent> domainEvents)
Dispatches a collection of domain events in emission order synchronously.
- domainEvents: IReadOnlyList<IDomainEvent>
- The read-only collection of domain events to dispatch.
methodDispatchAsync
ValueTask DispatchAsync(IReadOnlyList<IDomainEvent> domainEvents, CancellationToken cancellationToken = default)
Dispatches a collection of domain events in emission order asynchronously.
- domainEvents: IReadOnlyList<IDomainEvent>
- The read-only collection of domain events to dispatch.
- cancellationToken: CancellationToken
- A token that can be used to cancel the asynchronous operation.
Retorna: A task representing the asynchronous operation.
interface
IEntity
Ensamblado: EricksonLopez.SharedKernelpublic interface IEntity
Defines a non-generic marker contract for domain entities.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
interface
IEntityId
Ensamblado: EricksonLopez.SharedKernelpublic interface IEntityId
Defines the non-generic contract for Guid-backed strongly-typed domain entity identifiers.
Miembros (3)
propertyIsDefault
bool IsDefault { get; }
Gets a value indicating whether the identifier equals the default uninitialized value (`Guid.Empty`).
propertyIsEmpty
bool IsEmpty { get; }
Gets a value indicating whether the identifier is empty (`Guid.Empty`).
propertyValue
Guid Value { get; }
Gets the underlying `Guid` value of the identifier.
interface
IEntityId<TSelf>
Ensamblado: EricksonLopez.SharedKernelpublic interface IEntityId<TSelf> : IEntityId, IParsable<TSelf>, IEquatable<TSelf> where TSelf : struct, IEntityId<TSelf>
Implementa: IEntityId, IEquatable<TSelf>, IParsable<TSelf>
Defines the generic contract for Guid-backed strongly-typed domain entity identifiers supporting zero-reflection instantiation.
Miembros (1)
methodCreate
static abstract TSelf Create(Guid value)
Creates an instance of `TSelf` wrapping the specified `value`.
- value: Guid
- The underlying `Guid` value.
Retorna: The strongly-typed identifier instance.
interface
IEntity<TId>
Ensamblado: EricksonLopez.SharedKernelpublic interface IEntity<TId> : IEntity where TId : notnull, IEquatable<TId>
Implementa: IEntity
Defines the contract for domain entities with a strongly-typed identifier.
interface
IHasDomainEvents
Ensamblado: EricksonLopez.SharedKernelpublic interface IHasDomainEvents
Defines the contract for domain objects capable of recording and releasing domain events.
Miembros (4)
methodClearDomainEvents
void ClearDomainEvents()
Clears all pending domain events recorded by this instance without returning them.
methodDrainDomainEvents
IReadOnlyList<IDomainEvent> DrainDomainEvents()
Transfers and clears all pending domain events recorded by this instance.
Retorna: A read-only collection of pending domain events in emission order, or an empty collection if no events were recorded.
methodRequeueDomainEvents
void RequeueDomainEvents(IEnumerable<IDomainEvent> events)
Re-queues previously drained domain events back into this instance, typically during transactional rollback.
- events: IEnumerable<IDomainEvent>
- The domain events to restore.
propertyDomainEvents
IReadOnlyList<IDomainEvent> DomainEvents { get; }
Gets a read-only view of pending domain events recorded by this instance without clearing them.
class
OperationTimeContext
Ensamblado: EricksonLopez.SharedKernelpublic static class OperationTimeContext
Provides an ambient per-operation timestamp so domain logic, auditing, and events can stay deterministic without threading a timestamp parameter through every entity method.
Miembros (4)
methodBeginScope
public static IDisposable BeginScope(DateTimeOffset timestamp)
Begins a new deterministic ambient operation time scope.
- timestamp: DateTimeOffset
- The frozen timestamp for the duration of this scope.
Retorna: An `IDisposable` scope that restores the previous timestamp upon disposal.
methodCurrentOrUtcNow
public static DateTimeOffset CurrentOrUtcNow()
Gets the current ambient operation timestamp if available, or returns `TimeProvider.System`'s current UTC timestamp.
Retorna: The deterministic operation timestamp in UTC.
methodReset
public static void Reset()
Resets the ambient operation time context for the current asynchronous execution context.
propertyCurrent
public static DateTimeOffset? Current { get; }
Gets the current ambient operation timestamp if a scope is active; otherwise, `null`.