Infrastructure
This commit is contained in:
@@ -11,6 +11,8 @@ public abstract class Entity<T>
|
||||
CreateOn = DateTime.Now;
|
||||
}
|
||||
public T Id { get; protected set; }
|
||||
public byte[] RowVersion { get; private set; }
|
||||
|
||||
public DateTime CreateOn { get; init ; }
|
||||
private List<IDomainEvent> _domainEvents;
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
namespace Vizhvizh.BuildingBlocks.Domain;
|
||||
|
||||
public interface IRepositoryBase<TDomain, TId>
|
||||
where TDomain : Entity<TId> where TId : ITypeIdValueBase
|
||||
public interface IRepositoryBase<T, TId>
|
||||
where T : Entity<TId> where TId : ITypeIdValueBase
|
||||
{
|
||||
Task CreateAsync(TDomain entity, CancellationToken cancellationToken = default);
|
||||
Task UpdateAsync(TDomain entity, CancellationToken cancellationToken = default);
|
||||
Task DeleteAsync(TId id, CancellationToken cancellationToken = default);
|
||||
Task<TDomain> GetByIdAsync(TId id, CancellationToken cancellationToken = default);
|
||||
Task AddAsync(T entity, CancellationToken cancellationToken);
|
||||
Task UpdateAsync(T entity, CancellationToken cancellationToken);
|
||||
Task DeleteAsync(TId id, CancellationToken cancellationToken);
|
||||
Task DeleteAsync(T entity, CancellationToken cancellationToken);
|
||||
Task<T?> FindByIdAsync(TId id, CancellationToken cancellationToken);
|
||||
IQueryable<T> GetQueryAsNoTracking();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user