internal static TransactionGetResult FromOther(
            TransactionGetResult doc,
            IContentAsWrapper content)
        {
            // TODO: replacement for Links

            return(new TransactionGetResult(
                       doc.Id,
                       content,
                       doc.Cas,
                       doc.Collection,
                       doc.TransactionXattrs,
                       doc.DocumentMetadata,
                       doc.IsDeleted
                       ));
        }
 private TransactionGetResult(
     string id,
     IContentAsWrapper?content,
     ulong cas,
     ICouchbaseCollection collection,
     TransactionXattrs?transactionXattrs,
     DocumentMetadata?documentMetadata,
     bool isTombstone)
 {
     Id = id;
     FullyQualifiedId = GetFullyQualifiedId(collection, id);
     _content         = content ?? new JObjectContentWrapper(new { });
     Cas               = cas;
     Collection        = collection;
     TransactionXattrs = transactionXattrs;
     DocumentMetadata  = documentMetadata;
     IsDeleted         = isTombstone;
 }
        internal static TransactionGetResult FromInsert(
            ICouchbaseCollection collection,
            string id,
            IContentAsWrapper content,
            string transactionId,
            string attemptId,
            string atrId,
            string atrBucketName,
            string atrScopeName,
            string atrCollectionName,
            ulong updatedCas,
            bool isDeleted
            )
        {
            var txn = new TransactionXattrs();

            txn.AtrRef = new AtrRef()
            {
                BucketName     = atrBucketName,
                CollectionName = atrCollectionName,
                ScopeName      = atrScopeName,
                Id             = atrId
            };

            txn.Id = new CompositeId()
            {
                Transactionid = transactionId,
                AttemptId     = attemptId
            };

            return(new TransactionGetResult(
                       id,
                       content,
                       updatedCas,
                       collection,
                       txn,
                       null,
                       isDeleted
                       ));
        }
 internal static TransactionGetResult FromNonTransactionDoc(ICouchbaseCollection collection, string id, IContentAsWrapper content, ulong cas, DocumentMetadata documentMetadata, bool isDeleted, TransactionXattrs?transactionXattrs)
 {
     return(new TransactionGetResult(
                id: id,
                content: content,
                cas: cas,
                collection: collection,
                transactionXattrs: transactionXattrs,
                documentMetadata: documentMetadata,
                isTombstone: isDeleted
                ));
 }