获取DateTime类型的Max方法

时间:2015-02-08 09:04:46

标签: vb.net datetime reflection

我正在寻找一个返回Enumerable.Max的{​​{1}}方法,但似乎此方法不存在。

我尝试使用反射来查找它,但没有一个结果返回DateTime

DateTime

有这样的方法吗?

1 个答案:

答案 0 :(得分:1)

Enumerable没有为Max类型指定DateTime方法,但它具有通用Max(IEnumerable<TSource>)方法,可以处理实现IComparable<T>或{的类的对象{1}}接口,包括IComparable

所以你可以使用这个方法:

DateTime