public bool Equals(WeekModel obj)
 {
     if (object.ReferenceEquals(obj, null))
     {
         return(false);
     }
     return(WeekModel.Equals(this, obj));
 }
        public static WeekModel GetRecord(string xml)
        {
            using (TextReader reader = new StringReader(xml))
            {
                WeekModel result = serializer.Deserialize(reader) as WeekModel;
                if (result != null)
                {
                    result.Monday.DayOfWeek    = DayOfWeek.Monday;
                    result.Tuesday.DayOfWeek   = DayOfWeek.Tuesday;
                    result.Wednesday.DayOfWeek = DayOfWeek.Wednesday;
                    result.Thursday.DayOfWeek  = DayOfWeek.Thursday;
                    result.Friday.DayOfWeek    = DayOfWeek.Friday;
                    result.Saturday.DayOfWeek  = DayOfWeek.Saturday;
                    result.Sunday.DayOfWeek    = DayOfWeek.Sunday;
                }

                return(result);
            }
        }
        public static bool Equals(WeekModel obj1, WeekModel obj2)
        {
            if (object.ReferenceEquals(obj1, null) && object.ReferenceEquals(obj2, null))
            {
                return(true);
            }

            if (object.ReferenceEquals(obj1, null) || object.ReferenceEquals(obj2, null))
            {
                return(false);
            }

            return(obj1.Monday == obj2.Monday &&
                   obj1.Tuesday == obj2.Tuesday &&
                   obj1.Wednesday == obj2.Wednesday &&
                   obj1.Thursday == obj2.Thursday &&
                   obj1.Friday == obj2.Friday &&
                   obj1.Saturday == obj2.Saturday &&
                   obj1.Sunday == obj2.Sunday);
        }
 public static bool operator !=(WeekModel obj1, WeekModel obj2)
 {
     return(!WeekModel.Equals(obj1, obj2));
 }