我有填充和排序的動態列表動態列表:排序不工作
List<dynamic> eventList = new List<object>();
foreach (Task t in tasks)
{
eventList.Add(
new
{
id = "t" + t.TaskID.ToString(),
title = t.TaskTitle,
start = ResolveStartDate(StartDate(t.Schedule.DateFrom.Value)),
end = ResolveEndDate(StartDate(t.Schedule.DateFrom.Value), t.Schedule.Hours.Value),
description = t.TaskDescription,
allDay = false,
resource = t.Schedule.EmployeID.ToString(),
color = ColorConversion.HexConverter(System.Drawing.Color.FromArgb(t.Project.Color.Value))
}
);
}
foreach (Case c in cases)
{
eventList.Add(
new
{
id = "c" + c.CaseID.ToString(),
title = c.CaseTitle + "-" + c.Customer.CustomerDescription,
start = ResolveStartDate(StartDate(c.Schedule.DateFrom.Value)),
end = ResolveEndDate(StartDate(c.Schedule.DateFrom.Value), c.Schedule.Hours.Value),
description = c.CaseDescription,
allDay = false,
resource = c.Schedule.EmployeID.ToString(),
color = ColorConversion.HexConverter(System.Drawing.Color.FromArgb(c.Color.Value))
}
);
}
eventList.OrderBy(p => p.title);
當我在調試模式之前和排序調用後檢查,該名單是不是在所有排序,它是在訂單添加。
當我運行它時,我看不到任何東西被排序。什麼可能是錯的?