Hi there .
i am useing the following Code trying to get the maxValue from a list but it gives me an Exception (At least one object must implement IComparable) !
I need help to get a solution and explanation why this Exception
Hide Copy Code
public static TheQFromDB GetMaxWithLINQ (List input)
{
TheQFromDB GetItem = input.First();
foreach (var item in input)
{
var max = input.OrderByDescending(s=> s.SecondsDiff).Max();
GetItem = item;
}
return GetItem;
}

Jaish MathewsRank #225 · 11K reputationPosted Apr 29, 2019, 3:53 AM EDT
Manoj BhoirRank #599 · 4K reputationPosted Apr 29, 2019, 3:43 AM EDT
Abdalla OmranRank #5,857 · 284 reputationPosted Apr 29, 2019, 4:00 AM EDT