I have a number of objects defined, each has a property named "CreateDate".
Is it possible to write a single, generic method to select the highest date from an object that I specify?
I was attempting to use a generic approach to this, but the compiler doesn't like it when I try to specify a property name.
I was trying to achieve something along these lines...
private static DateTime GetLastDate<T>(List<T> data)
{
// Unfortunately, this is not allowed...
return
(from d in data
orderby d.CreateDate
select d.CreateDate).FirstOrDefault();
}