Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
EntityCollection.Load())
Message
De
13/08/2009 12:14:51
 
 
À
13/08/2009 11:34:56
Information générale
Forum:
ASP.NET
Catégorie:
LINQ
Divers
Thread ID:
01417891
Message ID:
01417904
Vues:
44
>I'm working with the Entity Framework and using the .Load() method with severtal EntityCollection T objects. The problem is that the method has no built-in way of sorting the resulting collection. Any suggestions on how, or even whether, this may be achieved?

Think I've found a workable solution.
Instead of using Children.Load() (where Children is the EntityCollection) I can use:
foreach (var v in this.Children.CreateSourceQuery().OrderBy(o=>o.Name))
                            Children.Add(v);
Only snag is that I can no longer user Children.IsLoaded to track whether the collection has been populated but I can do that myself. And, of course, addred items as not sorted but I can live with that......
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform