I am trying to get something like the following to work:
_dbmsParentSections = FactoryTools.Factory.PdfSections
.Include(x => x.Ch
I use this code por order the include, using a select and a function to order the collection. Is not the best but work fine if subcollection is small
// GET: api/Tareas
[HttpGet]
public IEnumerable GetTareas()
{
var result = _context.Tareas
.Include(p => p.SubTareas)
.Select(p => SortInclude(p));
return result;
}
private Tarea SortInclude(Tarea p)
{
p.SubTareas = (p.SubTareas as HashSet)?
.OrderBy(s => s.Position)
.ToHashSet();
return p;
}