IsWeekend

public static bool IsWeekend(this DateTime value)
{
    return (value.DayOfWeek == DayOfWeek.Sunday || value.DayOfWeek == DayOfWeek.Saturday);
}
Example:
for (DateTime date = dateFrom; date <= dateTo; date = date.AddDays(1))
{
    if (date.IsWeekend()) continue;
    // do some date related stuff
}

Description

Lets you easily figure out ifdateTime holds a date value that is a weekend.

Details

Double click on the code to select all.

 

;