Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return _context.Sala
- .Include(i => i.Armarios)
- .ThenInclude(t => t.Huecos)
- .AsEnumerable()
- .Select(x =>
- {
- foreach (Armario ar in x.Armarios)
- {
- foreach(Hueco hu in ar.Huecos)
- {
- var cat = _context.Categoria.FirstOrDefault(f => f.Id == hu.CategoriaId);
- hu.Categoria = new Categoria() { Id = cat.Id, Nombre = cat.Nombre};
- }
- }
- return x;
- });
Add Comment
Please, Sign In to add comment