Get the next date based on a collection of valid weekdays public static DateTime NextByDayOfWeek(this DateTime target, IEnumerable&lt;DayOfWeek&gt; validDaysOfWeek)
{
    validDaysOfWeek = validDaysOfWeek
        .OrderBy(item =&gt; item);

    var nextDayOfWeek = validDaysOfWeek
        .Where(item =&gt; item &gt; target.DayOfWeek)
        .FirstOrDefault();

    return nextDayOfWeek != 0
        ? target.AddDays(nextDayOfWeek - target.DayOfWeek)
        : target.AddDays((validDaysOfWeek.First() + 7) - target.DayOfWeek);
}


Usage:

DateTime.Today.NextByDayOfWeek(new[] { DayOfWeek.Monday, DayOfWeek.Friday })


I don't think there are any possible edge cases here, at least some initial tests don't reveal any problem.

I think it's short and readable, but readability is often hard to judge when you're the author.

Any remarks?
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.