title: Get The next days but not weekends, asp.net c#
body: <p>Im trying to get the next five weekdays and im stuck.</p>
  
  <p>Ive started like this:</p>
  
  <pre><code>        List&lt;DateTime&gt; allWeekEndsInOneYear = new List&lt;DateTime&gt;();
  
          DateTime sDate = DateTime.Now;
          DateTime eDate = DateTime.Now.AddYears(1);
  
          TimeSpan diff = eDate - sDate;
          int days = diff.Days;
          for (var i = 0; i &lt;= days; i++)
          {
              var testDate = sDate.AddDays(i);
              switch (testDate.DayOfWeek)
              {
                  case DayOfWeek.Saturday:
                  case DayOfWeek.Sunday:
                      allWeekEndsInOneYear.Add(testDate);
                      break;
              }
          }
  
          List&lt;DateTime&gt; daysToMark = new List&lt;DateTime&gt;();
  
          DateTime startDate = DateTime.Now;
          DateTime endDate = DateTime.Now.AddDays(5);
  </code></pre>
  
  <p>Now I need to fill daysToMark with the next 5 days excluding the weekeds (the ones in allWeekEndsInOneYear). Any help is very appreciated.</p>