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);
|
||||
}
|
||||
@@ -7,7 +7,7 @@ using AipsCore.Domain.Models.Whiteboard.ValueObjects;
|
||||
|
||||
namespace AipsCore.Domain.Models.Shape;
|
||||
|
||||
public abstract class Shape : DomainEntity<ShapeId>
|
||||
public abstract class Shape : DomainModel<ShapeId>
|
||||
{
|
||||
public WhiteboardId WhiteboardId { get; private set; }
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using AipsCore.Domain.Models.User.ValueObjects;
|
||||
|
||||
namespace AipsCore.Domain.Models.User;
|
||||
|
||||
public class User : DomainEntity<UserId>
|
||||
public class User : DomainModel<UserId>
|
||||
{
|
||||
public Email Email { get; private set; }
|
||||
public Username Username { get; private set; }
|
||||
|
||||
@@ -5,7 +5,7 @@ using AipsCore.Domain.Models.Whiteboard.ValueObjects;
|
||||
|
||||
namespace AipsCore.Domain.Models.Whiteboard;
|
||||
|
||||
public class Whiteboard : DomainEntity<WhiteboardId>
|
||||
public class Whiteboard : DomainModel<WhiteboardId>
|
||||
{
|
||||
public UserId WhiteboardOwnerId { get; private set; }
|
||||
public WhiteboardCode Code { get; private set; }
|
||||
|
||||
@@ -5,7 +5,7 @@ using AipsCore.Domain.Models.WhiteboardMembership.ValueObjects;
|
||||
|
||||
namespace AipsCore.Domain.Models.WhiteboardMembership;
|
||||
|
||||
public class WhiteboardMembership : DomainEntity<WhiteboardMembershipId>
|
||||
public class WhiteboardMembership : DomainModel<WhiteboardMembershipId>
|
||||
{
|
||||
public WhiteboardId WhiteboardId { get; private set; }
|
||||
public UserId UserId { get; private set; }
|
||||
|
||||
Reference in New Issue
Block a user