using Microsoft.EntityFrameworkCore; using MTWorkHR.Core.Entities; using MTWorkHR.Core.IDto; using MTWorkHR.Core.IRepositories; using MTWorkHR.Identity.Entities; using MTWorkHR.Infrastructure.Data; namespace MTWorkHR.Infrastructure.Repositories { public class UserTaskRepository : Repository, IUserTaskRepository { private readonly DbSet dbSet; public UserTaskRepository(HRDataContext context) : base(context) { dbSet = context.Set(); } public async Task GetByIdWithAllChildren(long id) { return await dbSet .Include(x => x.TaskAttachments).ThenInclude(a => a.AttachmentType) .Include(x => x.UserTaskHistories) .Include(x => x.TaskStatus) .Include(x => x.Project) .FirstOrDefaultAsync(x => x.Id == id); } } }