Get the next date based on a collection of valid weekdays
You can just step forward one day at a time, until you find a week day that is valid. If you change the second parameter to a params parameter, as svick suggested, the code gets very straight forward:

public static DateTime NextByDayOfWeek(this DateTime target, params DayOfWeek[] validDaysOfWeek) {
  do {
    target = target.AddDays(1);
  } while (!validDaysOfWeek.Contains(target.DayOfWeek));
  return target;
}


You can also make a bitmask out of the valid days, so that you don't have to use the Contains method, which would loop through the collection of valid days for each iteration:

public static DateTime NextByDayOfWeek(this DateTime target, IEnumerable&lt;DayOfWeek&gt; validDaysOfWeek) {
  int valid = 0;
  foreach (DayOfWeek d in validDaysOfWeek) {
    valid |= 1 &lt;&lt; (int)d;
  }
  do {
    target = target.AddDays(1);
  } while ((valid &amp; 1 &lt;&lt; (int)target.DayOfWeek) == 0);
  return target;
}


I tested both these functions with a range of different values, and they seem to give the correct result in all cases.