11,578 questions
Check a solution:
public static List<DateTime> GetPreviousDates( int count, DateTime startDate, int interval )
{
return Enumerable.Range( 1, count ).Select( c => startDate.AddDays( -c * interval ) ).ToList( );
}
However, the original loop probably works differently and incorrectly when count is zero.