I am trying to compare DateTimeOffset types. I am checking that the start date is not greater than the end date, but even when the start date is not greater than the end date it fails.
I debugged and hovered over this bit of code that is throwing the exception. The start value is 8/29/2013 and the end date is 9/1/2014.
Example Code:>
public IEnumerable<RecruitingPerformance> GetDailyRecruitingPerformance(DateTimeOffset start, DateTimeOffset end, int? userId, int? projectId)
{
if (end > DateTimeOffset.UtcNow)
{
throw new ArgumentException("End date must be today or before.", "end");
}
if (start > end)
{
throw new ArgumentException("Date must be greater than or equal to start", "end");
}
Picture of trouble spot:>
Here is picture of the two objects for the non believers: