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

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -