Skip to content

Instantly share code, notes, and snippets.

@lgolubyev
Created Jun 16, 2022
Embed
What would you like to do?
switch (DateTime.Now.DayOfWeek)
{
case DayOfWeek.Monday:
case DayOfWeek.Tuesday:
case DayOfWeek.Wednesday:
case DayOfWeek.Thursday:
case DayOfWeek.Friday:
return "Not Weekend";
case DayOfWeek.Saturday:
case DayOfWeek.Sunday:
return "Weekend";
default:
throw new ArgumentOutOfRangeException();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment