65 lines
2.3 KiB
C#
65 lines
2.3 KiB
C#
using BulkyBook.DataAccess.Repository;
|
|
using Marco.Pms.DataAccess.Data;
|
|
using Marco.Pms.DataAccess.Repository.IRepository;
|
|
|
|
namespace Marco.Pms.DataAccess.Repository
|
|
{
|
|
public class UnitOfWork : IUnitOfWork
|
|
{
|
|
private readonly ApplicationDbContext _db;
|
|
|
|
public IApplicationUserRepository ApplicationUser { get; private set; }
|
|
|
|
public IEmployeeRepository Employee { get; private set; }
|
|
public ITaskAllocationRepository EmployeeAllocation { get; private set; }
|
|
|
|
public IProjectRepository Project { get; private set; }
|
|
public IProjectAllocationRepository ProjectAllocation { get; private set; }
|
|
|
|
public IBuildingRepository Building { get; private set; }
|
|
public IFloorRepository Floor { get; private set; }
|
|
public IAttendenceRepository Attendence { get; private set; }
|
|
|
|
public IWorkAreaRepository WorkArea { get; private set; }
|
|
|
|
public IWorkItemRepository WorkItem { get; private set; }
|
|
|
|
public IWorkItemMappingReposiotry WorkItemMapping { get; private set; }
|
|
|
|
public IStatusRepository StatusMaster { get; private set; }
|
|
public IActivityMasterRepository ActivityMaster { get; private set; }
|
|
public IApplicationRolesRepository EmployeeRoles { get; private set; }
|
|
public IFeatureRepository Features { get; private set; }
|
|
|
|
|
|
public UnitOfWork(ApplicationDbContext db)
|
|
{
|
|
_db = db;
|
|
Employee = new EmployeeRepository(_db);
|
|
Project = new ProjectRepository(_db);
|
|
ProjectAllocation = new ProjectAllocationRepository(_db);
|
|
|
|
Building = new BuildingRepository(_db);
|
|
Floor = new FloorRepository(_db);
|
|
WorkArea = new WorkAreaRepository(_db);
|
|
WorkItem = new WorkItemRepository(_db);
|
|
WorkItemMapping = new WorkItemMappingReporitury(_db);
|
|
|
|
ApplicationUser = new ApplicationUserRepository(_db);
|
|
Attendence = new AttendenceRepository(_db);
|
|
EmployeeAllocation = new TaskAllocationRepository(_db);
|
|
|
|
StatusMaster = new StatusRepository(_db);
|
|
ActivityMaster = new ActivityMasterRepository(_db);
|
|
EmployeeRoles = new ApplicationRolesRepository(_db);
|
|
Features = new FeaturesRepository(_db);
|
|
|
|
}
|
|
|
|
public void Save()
|
|
{
|
|
_db.SaveChanges();
|
|
}
|
|
}
|
|
}
|