DateRange

public static class ext
{
    public static IEnumerable<DateTime> GetDateRangeTo(this DateTime self, DateTime toDate)
    {
        var range = Enumerable.Range(0,new TimeSpan(toDate.Ticks - self.Ticks).Days);

        return from p in range
               select self.Date.AddDays(p);
    }
}
Example:
// Get next 80 days
IEnumerable<DateTime> dateRange = DateTime.Now.GetDateRangeTo(DateTime.Now.AddDays(80));

Description

A simple date range

Details

Double click on the code to select all.

 

;