Guest User

Untitled

a guest
Jul 23rd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. return _context.Sala
  2. .Include(i => i.Armarios)
  3. .ThenInclude(t => t.Huecos)
  4. .AsEnumerable()
  5. .Select(x =>
  6. {
  7. foreach (Armario ar in x.Armarios)
  8. {
  9. foreach(Hueco hu in ar.Huecos)
  10. {
  11. var cat = _context.Categoria.FirstOrDefault(f => f.Id == hu.CategoriaId);
  12. hu.Categoria = new Categoria() { Id = cat.Id, Nombre = cat.Nombre};
  13. }
  14. }
  15. return x;
  16. });
Add Comment
Please, Sign In to add comment