protected override Expression <Func <UnicodeMaxStringReference, bool> > FindExisting(UnicodeMaxStringReference record)
 => existing => existing.Hash == record.Hash;
Exemplo n.º 2
0
 protected override async Task <UnicodeMaxStringReference> AssignUpsertedReferences(UnicodeMaxStringReference record)
 => (await _hash.UpsertComputedHash(record)) as UnicodeMaxStringReference;
        protected override async Task <UnicodeMaxStringReference> AssignUpsertedReferences(UnicodeMaxStringReference record)
        {
            var bytes = new xxHash(64).ComputeHash(Encoding.UTF8.GetBytes(record.Value));
            var hash  = new AsciiStringReference {
                Value = Convert.ToBase64String(bytes)
            };

            hash = await _strings.UpsertAsync(hash);

            record.Hash   = hash;
            record.HashId = hash.AsciiStringReferenceId;
            return(record);
        }
Exemplo n.º 4
0
 public FileContent(string content)
 {
     Content   = new UnicodeMaxStringReference(content);
     DateAdded = DateTimeOffset.UtcNow;
 }