27 lines
937 B
C#
27 lines
937 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using _0_Framework.InfraStructure;
|
|
using Company.Domain.EmployeeDocumentItemAgg;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace CompanyManagment.EFCore.Repository;
|
|
|
|
public class EmployeeDocumentItemRepository:RepositoryBase<long,EmployeeDocumentItem>,IEmployeeDocumentItemRepository
|
|
{
|
|
private readonly CompanyContext _context;
|
|
public EmployeeDocumentItemRepository(CompanyContext context) : base(context)
|
|
{
|
|
_context = context;
|
|
}
|
|
|
|
public EmployeeDocumentItem GetWithEmployeeDocumentsByItemId(long id)
|
|
{
|
|
return _context.EmployeeDocumentItems.Include(x => x.EmployeeDocuments).FirstOrDefault(x => x.id == id);
|
|
}
|
|
|
|
public List<EmployeeDocumentItem> GetUnsubmittedByEmployeeDocumentsId(long employeeDocumentsId)
|
|
{
|
|
return _context.EmployeeDocumentItems.Where(x => x.EmployeeDocumentId == employeeDocumentsId).ToList();
|
|
}
|
|
|
|
} |