2023-11-09 14:35:08 +07:00
|
|
|
|
using BMA.EHR.Application.Common.Interfaces;
|
2023-11-10 14:40:53 +07:00
|
|
|
|
using BMA.EHR.Domain.Models.Leave.TimeAttendants;
|
2023-11-09 14:35:08 +07:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BMA.EHR.Infrastructure.Persistence
|
|
|
|
|
|
{
|
2023-11-13 16:56:17 +07:00
|
|
|
|
public class LeaveDbContext : DbContext, ILeaveDbContext
|
2023-11-09 14:35:08 +07:00
|
|
|
|
{
|
2023-11-10 14:40:53 +07:00
|
|
|
|
#region " Check-In "
|
2023-11-09 14:35:08 +07:00
|
|
|
|
|
|
|
|
|
|
public DbSet<DutyTime> DutyTimes { get; set; }
|
|
|
|
|
|
|
2023-11-10 14:40:53 +07:00
|
|
|
|
public DbSet<UserTimeStamp> UserTimeStamps { get; set; }
|
|
|
|
|
|
|
2023-11-23 10:35:55 +07:00
|
|
|
|
public DbSet<ProcessUserTimeStamp> ProcessUserTimeStamps { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public DbSet<UserDutyTime> UserDutyTimes { get; set; }
|
|
|
|
|
|
|
2023-11-09 14:35:08 +07:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public LeaveDbContext(DbContextOptions<LeaveDbContext> options) : base(options)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Task<int> SaveChangesAsync()
|
|
|
|
|
|
{
|
|
|
|
|
|
return base.SaveChangesAsync();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Attatch<T>(T entity) where T : class
|
|
|
|
|
|
{
|
|
|
|
|
|
Attach(entity);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|