Infrastructure

This commit is contained in:
2026-04-22 20:51:02 +04:30
parent c64c3dd9be
commit 64ee78e320
199 changed files with 7428 additions and 1027 deletions
+2
View File
@@ -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();
}