我想知道是否有人可以告诉我或给我一个指南,告诉我如何按名称订购对象列表(键,名称),但名称是 LocalizedText 格式,也许我很愚蠢,但我无法订购此列表.
//Objects definied on my class:
[DataMember]
public virtual Guid ComplaintPreventableStateId { get; set; }
[DataMember]
public virtual LocalizedText Name { get; set; }
//function that tries to get information:
IList<ComplaintPreventableState> complaintPreventableList = new List<ComplaintPreventableState>();
complaintPreventableList = (from c in ComplaintPreventableState.All select c).ToList();
//Tried this two options:
complaintPreventableList.OrderByDescending(h => h.Name);
complaintPreventableList.OrderBy(h => h.Name);