开发者

Sort List Of Class using Id property?

I have a class called Questions. This Questions has properties QuestionID and QuestionAnswer. My list of Questions has 开发者_如何学编程QuestionID like 2,3,4,15,12,24,22,,,, etc

I need to sort this List of Questions Object based on QuestionID and store in another Questions object.


There is a framework called LINQ designed for this exact sort of task. For example, in C#:

var sortedList = questionList.OrderBy(q => q.QuestionID).ToList();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜