Compare datetime elements in a list c#

.net, .net-4.0, c#, compare, list

Solution

Basically I want to check all the items are equal or not.

No need for `DateTime.Compare`. Just check

dateList.Distinct().Count();

If it is equal to 1 then they are equal but if it is more than 1 then No, they are not equal.

Problem

I have list of `datetime` values and I am trying to compare each item against all items. ``` var dateList = new List<DateTime>(); ``` Basically I want to check all the items are equal or not. Think I can use DateTime.Compare, but I am not sure how to go through each element and compare.

Original source