Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert Item In Dictionary
Message
De
05/05/2010 04:42:20
 
 
À
04/05/2010 11:39:53
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01462835
Message ID:
01463169
Vues:
48
>>>
>>>You would order the linq result by his Order Value... and process them...
>>
>>So you're not talking about inserting items into a List in specific locations but using Linq to pull an OrderedEnumerable from the random list? Something like:
 var v = from t in things orderby t.Order select t;
>>foreach (Thing x in v)
>>   { //... }
>
>
>I'm so confused. I was responding to mike about inserting into a specific position in that dictionaries do not support that and list/array do. That's all.

OK. Just thought that you had a way of using the List index to sort items as added.....
>
>As to Kevin, I don't know why he wants to insert into a specific location in a dictionary, I simply said it could be added as normal and then when required perform a linq query ordered by his variable as above and process them. I don't know what he's trying to do or really care. Just making an observation.

Don't know exactly what Kevin wanted either. But since he asked about a sorted dictionary then SortedDictionary seemed the way to go :-}
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform