Example #1
0
        public override bool Equals(object obj)
        {
            if (!(obj is ParseDate))
            {
                return(false);
            }

            ParseDate other = (ParseDate)obj;

            // No need to compare UtcTime. 1) It's not actually serialized, and 2) is more error-prone to trivial differences showing up
            return(this.Iso == other.Iso);
        }
Example #2
0
        /// <summary>
        /// A constructor that allows setting readonly fields
        /// </summary>
        internal BookModel(string baseUrl, string title, bool isInCirculation = true, ParseDate lastUploaded = null)
        {
            this.BaseUrl         = baseUrl;
            this.Title           = title;
            this.IsInCirculation = isInCirculation;
            this.LastUploaded    = lastUploaded;

            // Enhance: add more readonly fields as needed
        }