我已经尝试过SortedList.Select(x => x.MyProperty,x.AnotherProperty),但它不工作.
谢谢.
var result = SortedList.Select(x => new { x.Value.MyProperty,x.Value.AnotherProperty });
或者如果要使用当前方法范围之外的结果,您可以定义自定义类型:
IEnumerable<MyType> result = SortedList.Select(x => new MyType { Prop1 = x.Value.MyProperty,Prop2 = x.Value.AnotherProperty });