示例#1
0
        public static int Compare(PostId first, long second)
        {
            if (first is null)
            {
                return(-1);
            }

            return(first.Value.CompareTo(second));
        }
示例#2
0
 public int CompareTo(object obj)
 {
     return(obj switch
     {
         null => 1,
         PostId other => Compare(this, other),
         long otherValue => Compare(this, otherValue),
         string stringValue => this.CompareTo(stringValue),
         _ => - 1
     });
示例#3
0
 public Origin(string author, string postID, int postNumber, DateTime timestamp, Uri thread, string permalink)
 {
     Author           = author;
     AuthorType       = IdentityType.User;
     ID               = new PostId(postID);
     ThreadPostNumber = postNumber;
     Timestamp        = timestamp;
     Thread           = thread;
     Permalink        = permalink;
     Source           = Empty;
     hash             = ComputeHash();
 }
示例#4
0
 private Origin(string author, IdentityType identityType, PostId postId, int postNumber, DateTime timestamp,
                Uri thread, string permalink, Origin source)
 {
     Author           = author;
     AuthorType       = identityType;
     ID               = postId;
     ThreadPostNumber = postNumber;
     Timestamp        = timestamp;
     Thread           = thread;
     Permalink        = permalink;
     Source           = source;
     hash             = ComputeHash();
 }