数据查询:
IEnumerable<Trabajador> _trabajadores = _trabajadorRepository
.AllIncluding(t => t.Equipos, t => t.Equipos.Select(e => e.MaestroEquipos))
.OrderBy(u => u.Id)
.Skip((currentPage - 1) * currentPageSize)
.Take(currentPageSize)
.ToList();
方法AllIncluding:
public virtual IEnumerable<T> AllIncluding(params Expression<Func<T, object>>[] includeProperties)
{
IQueryable<T> query = _context.Set<T>();
foreach (var includeProperty in includeProperties)
{
query = query.Include(includeProperty);
}
return query.AsEnumerable();
}
如何获得第三张表?