REN Repository
How Should I Use RENRepository?
Why use RENRepository via Unit of Work?
public class EmployeeService
{
private readonly IRENUnitOfWork<RenDbContext> _unitOfWork;
public EmployeeService(IRENUnitOfWork<RenDbContext> unitOfWork)
{
_unitOfWork = unitOfWork;
}
public async Task<List<Employee>> GetAllEmployeesAsync()
{
var employeeRepo = _unitOfWork.GetRepository<Employee>();
return await employeeRepo.GetListAsync();
}
}Entity-Based Custom Repository: Flexibility with Control
Last updated