hi all,
I am trying to get the longest and shortest timespan in a list using LINQ. My code looks something like this
List listofTimeSpans = new List();
adding the timespans to listofTimeSpans in a foreach loop.
Please help me with this. Thank you.
hi all,
I am trying to get the longest and shortest timespan in a list using LINQ. My code looks something like this
List listofTimeSpans = new List();
adding the timespans to listofTimeSpans in a foreach loop.
Please help me with this. Thank you.
I would create the list as
var listofTimeSpans = new List<TimeSpan>();
then
var min = listofTimeSpans.Min();
var max = listofTimeSpans.Max();
Regards.