c# - How to assign index of the collection to property -


i have following linq query productionmachines.orderby(x => x.timedone).tolist(); want assign property x, index of it's location in collection. first productionmachines receive x equals 1 secound 2 , etc...

example productionmachines have 5 entries. productionmachine[0].x have 1 .. .. .. productionmachine[4].x have 5

use other form of select

productionsmachines.orderby(x => x.timedone)                                   .select( (x,i) =>                                         {                                            x.property = i+1;                                           return x;                                         }); 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -