public static class DateTimeExtensions
{
public static bool IsBusinessDay(this DateTime instance)
{
return instance.DayOfWeek != DayOfWeek.Saturday && instance.DayOfWeek != DayOfWeek.Sunday;
}
public static DateTime AddBusinessDays(this DateTime instance, int days)
{
var newDate = instance;
while (days > 0)
{
newDate = newDate.AddDays(-1);
if (newDate.IsBusinessDay())
--days;
}
return newDate;
}
}