public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Id != null?Id.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
                hashCode = (int)((hashCode * 397) ^ SizeBytes);
                hashCode = (hashCode * 397) ^ (MD5Hash != null ? MD5Hash.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (MimeType != null ? MimeType.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Width;
                hashCode = (hashCode * 397) ^ Height;
                hashCode = (hashCode * 397) ^ DateAddedUtc.GetHashCode();
                return(hashCode);
            }
        }
        public bool Equals(ImageThumbnail other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(Id == other.Id &&
                   SizeBytes == other.SizeBytes &&
                   MD5Hash == other.MD5Hash &&
                   Width == other.Width &&
                   Height == other.Height &&
                   Name == other.Name &&
                   MimeType == other.MimeType &&
                   DateAddedUtc.Equals(other.DateAddedUtc));
        }
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = PartitionKey != null?PartitionKey.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (Id != null ? Id.GetHashCode() : 0);
                hashCode = (int)((hashCode * 397) ^ SizeBytes);
                hashCode = (hashCode * 397) ^ (MD5Hash != null ? MD5Hash.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Width;
                hashCode = (hashCode * 397) ^ Height;
                hashCode = (hashCode * 397) ^ DateAddedUtc.GetHashCode();
                hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (MimeType != null ? MimeType.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (FileExtension != null ? FileExtension.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Tags != null ? Tags.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Thumbnails != null ? Thumbnails.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (int)ImageType;

                return(hashCode);
            }
        }
        public bool Equals(ImageMetadata other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            bool primitivePropertiesEqual = PartitionKey == other.PartitionKey &&
                                            Id == other.Id &&
                                            SizeBytes == other.SizeBytes &&
                                            MD5Hash == other.MD5Hash &&
                                            Width == other.Width &&
                                            Height == other.Height &&
                                            DateAddedUtc.Equals(other.DateAddedUtc) &&
                                            Name == other.Name &&
                                            MimeType == other.MimeType &&
                                            ImageType == other.ImageType &&
                                            FileExtension == other.FileExtension;

            bool tagsEqual = true;

            if (Tags != null && other.Tags != null && Tags.Count == other.Tags.Count)
            {
                foreach (var tag in Tags)
                {
                    if (!other.Tags.TryGetValue(tag.Key, out var value) || tag.Value != value)
                    {
                        tagsEqual = false;
                        break;
                    }
                }
            }
            else if (Tags == null && other.Tags == null)
            {
                tagsEqual = true;
            }
            else
            {
                tagsEqual = false;
            }

            bool thumbnailsEqual = true;

            if (Thumbnails != null && other.Thumbnails != null && Thumbnails.Count == other.Thumbnails.Count)
            {
                for (var i = 0; i < Thumbnails.Count; i++)
                {
                    var thumbnail = Thumbnails[i];
                    if (!thumbnail.Equals(other.Thumbnails[i]))
                    {
                        thumbnailsEqual = false;
                        break;
                    }
                }
            }
            else if (Thumbnails == null && other.Thumbnails == null)
            {
                thumbnailsEqual = true;
            }
            else
            {
                thumbnailsEqual = false;
            }

            return(primitivePropertiesEqual &&
                   tagsEqual &&
                   thumbnailsEqual);
        }