Refactored to follow naming convention
This commit is contained in:
@@ -2,18 +2,18 @@ using AipsCore.Domain.Common.ValueObjects;
|
||||
|
||||
namespace AipsCore.Domain.Abstract;
|
||||
|
||||
public abstract class DomainEntity<TId> where TId : DomainId
|
||||
public abstract class DomainModel<TId> where TId : DomainId
|
||||
{
|
||||
private readonly List<IDomainEvent> _domainEvents = [];
|
||||
|
||||
public TId Id { get; init; }
|
||||
|
||||
protected DomainEntity()
|
||||
protected DomainModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected DomainEntity(TId id)
|
||||
protected DomainModel(TId id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
@@ -2,11 +2,11 @@ using AipsCore.Domain.Common.ValueObjects;
|
||||
|
||||
namespace AipsCore.Domain.Abstract;
|
||||
|
||||
public interface IAbstractRepository<TEntity, in TId>
|
||||
where TEntity : DomainEntity<TId>
|
||||
public interface IAbstractRepository<TModel, in TId>
|
||||
where TModel : DomainModel<TId>
|
||||
where TId : DomainId
|
||||
{
|
||||
Task<TEntity?> GetByIdAsync(TId id, CancellationToken cancellationToken = default);
|
||||
Task SaveAsync(TEntity entity, CancellationToken cancellationToken = default);
|
||||
Task AddAsync(TEntity entity, CancellationToken cancellationToken = default);
|
||||
Task<TModel?> GetByIdAsync(TId id, CancellationToken cancellationToken = default);
|
||||
Task SaveAsync(TModel model, CancellationToken cancellationToken = default);
|
||||
Task AddAsync(TModel model, CancellationToken cancellationToken = default);
|
||||
}
|
||||
Reference in New Issue
Block a user