c# - How to sort list of class object -


i have list of model class object. class scoreboard have total score 1 property.

scoreboard scoreboard = new scoreboard(); 

i sorting list

data= data.orderbydescending(x => x.totalscore).tolist() 

but wont work. please should list of object of class.

if understood sorting issue correctly, might

    list<class1> scores = new list<class1>();     scores.add(new class1 { score = 1, totalscore = 2, user = "a" });     scores.add(new class1 { score = 1, totalscore = 5, user = "b" });     scores.add(new class1 { score = 1, totalscore = 3, user = "c" });      scores = scores.orderbydescending(x => x.totalscore).tolist(); 

this sort total score.


Comments

Popular posts from this blog

testing - Detect whether test has failed within fixture -

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

android - Create single AAR file from multiple modules using Gradle -