I am trying to compare current date with a calculated date from offset as shown below. The line throws an exception, enters catch block but exception is null. I cannot find what is the exception because of it
DateTime.UtcNow.Date.CompareTo(new UtcDateTime(startDate.AddDays(activity.DueInDaysOffset.GetValueOrDefault()))) > 0
startDate is date from DB
activity.DueInDaysOffset is an integer - positive/negative.
UtcDateTime is a class from 'Microsoft.CommonDataService' used for conversion.
What could be the issue?