Initial code commit.

This commit is contained in:
2026-02-03 10:44:31 +08:00
parent 8927c5ae0e
commit d69fe2cc1f
99 changed files with 10839 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using Sufi.Demo.PeopleDirectory.Domain.Common;
namespace Sufi.Demo.PeopleDirectory.Application.Contracts.Repositories
{
public interface IAsyncRepository<T, in TId> where T : class, IEntity<TId>
{
IQueryable<T> Entities { get; }
Task<T?> GetByIdAsync(TId id);
Task<List<T>> GetAllAsync();
Task<List<T>> GetPagedResponseAsync(int pageNumber, int pageSize);
Task<T> AddAsync(T entity);
Task UpdateAsync(T entity);
Task DeleteAsync(T entity);
Task<int> DeleteByIdAsync(TId id);
Task<int> CountAsync();
}
}

View File

@@ -0,0 +1,15 @@
using Sufi.Demo.PeopleDirectory.Domain.Common;
namespace Sufi.Demo.PeopleDirectory.Application.Contracts.Repositories
{
public interface IUnitOfWork<TId> : IDisposable
{
IAsyncRepository<T, TId> Repository<T>() where T : AuditableEntity<TId>;
Task<int> Commit(CancellationToken cancellationToken);
Task<int> CommitAndRemoveCache(CancellationToken cancellationToken, params string[] cacheKeys);
Task Rollback();
}
}