io sto cercando di ottenere qualcosa di simile a quanto segue per lavorare:Entity Framework ordinazione Include
_dbmsParentSections = FactoryTools.Factory.PdfSections
.Include(x => x.Children.OrderBy(y => y.Order).ToList())
.Include(x => x.Hint).Include(x => x.Fields)
.Where(x => x.FormId == FormId && x.Parent == null)
.OrderBy(o => o.Order)
.ToList();
La parte che causa l'eccezione è:
.Include(x => x.Children.OrderBy(y => y.Order).ToList())
EDIT:
Upon ulteriore osservazione,
_dbmsParentSections.ForEach(x => x.Children = x.Children.OrderBy(y => y.Order).ToList());
ha svolto il lavoro per me (dopo la chiamata iniziale Factory
e senza Children.OrderBy
).
Grazie per fornire la risposta che hai trovato lavorato per me partecipavano – Ronan