从存储库获取第三个相关表时出错

时间:2017-11-21 16:17:09

标签: c# entity-framework

我的表格 enter image description here

数据查询:

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();
    }

错误: enter image description here

如何获得第三张表?

0 个答案:

没有答案