Created
April 12, 2018 19:59
-
-
Save Flayed/0b0a7e3cdb95814ed2bf6c3bf48e9e1b to your computer and use it in GitHub Desktop.
Revisions
-
Flayed created this gist
Apr 12, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ public enum DayOfWeek { Sunday = 0, Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6 } private byte PackedDays { get; set; } public DayOfWeek StartDay { get { return (DayOfWeek)(PackedDays & 15); } set { PackedDays |= (byte)value; } } [BsonIgnore] public DayOfWeek EndDay { get { return (DayOfWeek)(PackedDays >> 4); } set { PackedDays |= (byte)((byte)value << 4); } }