Пример #1
0
 public QueryDocument(Guid schemaId, DocumentHash hash)
 {
     Id             = Guid.NewGuid();
     SchemaId       = schemaId;
     Hash           = hash;
     ExternalHashes = new HashSet <DocumentHash>();
     Published      = DateTime.UtcNow;
 }
Пример #2
0
 public SchemaVersion(
     Guid schemaId,
     string?externalId,
     DocumentHash hash,
     IReadOnlyList <Tag> tags,
     DateTime published)
     : this(Guid.NewGuid(), schemaId, externalId, hash, tags, published)
 {
 }
Пример #3
0
 public Query(
     DocumentHash hash,
     ISet <DocumentHash> externalHashes,
     DateTime published)
 {
     Id             = Guid.NewGuid();
     Hash           = hash;
     ExternalHashes = externalHashes;
     Published      = published;
 }
Пример #4
0
 public Query(
     Guid id,
     DocumentHash hash,
     ISet <DocumentHash> externalHashes,
     DateTime published)
 {
     Id             = id;
     Hash           = hash;
     ExternalHashes = externalHashes;
     Published      = published;
 }
Пример #5
0
 public QueryDocument(
     Guid schemaId,
     DocumentHash hash,
     ISet <DocumentHash> externalHashes,
     DateTime published)
 {
     Id             = Guid.NewGuid();
     SchemaId       = schemaId;
     Hash           = hash;
     ExternalHashes = externalHashes;
     Published      = published;
 }
Пример #6
0
 public SchemaVersion(
     Guid id,
     Guid schemaId,
     string?externalId,
     DocumentHash hash,
     IReadOnlyList <Tag> tags,
     DateTime published)
 {
     Id         = id;
     SchemaId   = schemaId;
     ExternalId = externalId ?? Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
     Hash       = hash;
     Tags       = tags;
     Published  = published;
 }
Пример #7
0
        public SchemaVersion(
            Guid id,
            Guid schemaId,
            string?externalId,
            DocumentHash hash,
            IReadOnlyList <Tag> tags,
            DateTime published)
        {
            if (tags.Count > 1)
            {
                tags = new HashSet <Tag>(tags, TagComparer.Default).ToList();
            }

            Id         = id;
            SchemaId   = schemaId;
            ExternalId = externalId ?? Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
            Hash       = hash;
            Tags       = tags;
            Published  = published;
        }