I have a simple POCO class that contains the student's scores.
For example:
Math - 83%
Engrish - 82%
Chemistry - 81%
Drama - 100%
etc..
Is there a way (using LINQ?) that I could figure out the top 3 properties ordered by score?
I'm assuming the final object will be an IList<T> of an anonymous type, which will have two fields.
- Name (the name of the property)
- Score (the decimal value).
The number of properties in the object ARE finite though :)
Any suggestions?
As an alternative answer, could this be done in a database instead?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…