Skip to content

Instantly share code, notes, and snippets.

@lgolubyev
Created June 16, 2022 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgolubyev/8536f3d589d91f79fce0f3c1494a0319 to your computer and use it in GitHub Desktop.
Save lgolubyev/8536f3d589d91f79fce0f3c1494a0319 to your computer and use it in GitHub Desktop.
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