ref: project structure
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using mws.backend.dotnet.application.Common;
|
||||
using mws.backend.dotnet.application.Common.Repositories;
|
||||
using mws.backend.dotnet.infrastructure.Persistence.Repositories;
|
||||
|
||||
namespace mws.backend.dotnet.infrastructure.Persistence;
|
||||
|
||||
public class UnitOfWork : IUnitOfWork
|
||||
{
|
||||
private readonly AppDbContext _db;
|
||||
|
||||
public UnitOfWork(AppDbContext db)
|
||||
{
|
||||
_db = db;
|
||||
Users = new UserRepository(db);
|
||||
Projects = new ProjectRepository(db);
|
||||
Tasks = new TaskRepository(db);
|
||||
Documents = new DocumentRepository(db);
|
||||
Roles = new RoleRepository(db);
|
||||
MasterData = new MasterDataRepository(db);
|
||||
}
|
||||
|
||||
public IUserRepository Users { get; }
|
||||
public IProjectRepository Projects { get; }
|
||||
public ITaskRepository Tasks { get; }
|
||||
public IDocumentRepository Documents { get; }
|
||||
public IRoleRepository Roles { get; }
|
||||
public IMasterDataRepository MasterData { get; }
|
||||
|
||||
public Task<int> SaveChangesAsync(CancellationToken ct = default) => _db.SaveChangesAsync(ct);
|
||||
}
|
||||
Reference in New Issue
Block a user