2班
public class Student
{
public int StudentID { get; set;}
public string Name { get; set;}
public List<Fee> Fees {get;set;}
}
public class Fee
{
public int FeeID { get; set;}
public decimal FeeAmount { get; set; }
}
假设有 10 个学生对象 Student[] stud = new Student[10]
如果 stud[0] 有 2 项费用( Fee[2] )并且他们是
FeeID=1, FeeAmount=54.23
FeeID=2, FeeAmount=234.98
如果 stud[1] 有 1 笔费用( Fee[2] )并且他们是
FeeID=1, FeeAmount=9.99
如果 stud[2] 有 3 项费用( Fee[3] )并且它们是
FeeID=1, FeeAmount=123.45
FeeID=2, FeeAmount=67.89
FeeID=3, FeeAmount=987.65
我需要按 TotalAmount(Fee Collection) 对学生收藏进行排序
TotalAmount of Fee
stud[0] = 54.23+234.98=289.21
stud[1] = =9,99
stud[2] = 123.45+67.89+987.65=1178.99
在那里排序后它应该变成
stud[0] = 123.45+67.89+987.65=1178.99
stud[1] = 54.23+234.98=289.21
stud[2] = =9,99