开发者

Linq - OrderBy the minimum value of two columns using lambda expressions?

开发者 https://www.devze.com 2022-12-14 21:12 出处:网络
I have an entity set that contains two DateTime properties. I want to order the set by the minimum value of the two proper开发者_如何学Goties. How can I do this with a lambda expression.myEntitySet.Or

I have an entity set that contains two DateTime properties. I want to order the set by the minimum value of the two proper开发者_如何学Goties. How can I do this with a lambda expression.


myEntitySet.OrderBy(e => e.DateA < e.DateB ? e.DateA : e.DateB);
0

精彩评论

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