I have an object that defines a network structure, I want to send over all children of that object and the children of the children and so on.
Right now I have this:
var Data = await _context.Scans
.Include(c => c.networkDevices)
.ThenInclude(d => d.ports)
.ThenInclude(p => p.Service)
.Include(c => c.root)
.ThenInclude(d => d.children).ThenInclude(p => p.children).ThenInclude(c => c.children)
.ToListAsync();
return Data;
This code will get most levels but if a network has many different layers it won't get all of them. How can i make it so that all layers get included.