Exemplo n.º 1
0
        public static int Compare(PostId first, long second)
        {
            if (first is null)
            {
                return(-1);
            }

            return(first.Value.CompareTo(second));
        }
Exemplo n.º 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
     });
Exemplo n.º 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();
 }
Exemplo n.º 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();
 }