コード例 #1
0
ファイル: Database.Tables.cs プロジェクト: Affixx/affixx
 public override int GetHashCode()
 {
     unchecked {
         const int randomPrime = 397;
         int       hashCode    = Id.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ (FullDocumentFileName != null ? FullDocumentFileName.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (FreeSnippetFileName != null ? FreeSnippetFileName.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (OriginalFileName != null ? OriginalFileName.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (Title != null ? Title.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (Description != null ? Description.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (Degree != null ? Degree.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (CourseName != null ? CourseName.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (CourseCode != null ? CourseCode.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (Year != null ? Year.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ UniversityId.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ UploadedBy.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ UploadedAt.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ (DeletedAt != null ? DeletedAt.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ IsFree.GetHashCode();
         hashCode = (hashCode * randomPrime) ^ (IsApproved != null ? IsApproved.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (Hash != null ? Hash.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ (MinHashSignature != null ? MinHashSignature.GetHashCode() : 0);
         hashCode = (hashCode * randomPrime) ^ CategoryId.GetHashCode();
         return(hashCode);
     }
 }
コード例 #2
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (FileName?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (FolderPath?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (MaxFileSize?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AllowedExtensions?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Blob?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (StorageMedium?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (UploadedBy?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (UploadDateTime?.GetHashCode() ?? 0);
            return(hashCode);
        }