public AttachmentName[] GetNames(object entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException(nameof(entity));
            }

            if (DocumentsByEntity.TryGetValue(entity, out var document) == false)
            {
                ThrowEntityNotInSession(entity);
            }

            if (document.Metadata.TryGet(Constants.Documents.Metadata.Attachments, out BlittableJsonReaderArray attachments) == false)
            {
                return(Array.Empty <AttachmentName>());
            }

            var results = new AttachmentName[attachments.Length];

            for (var i = 0; i < attachments.Length; i++)
            {
                var attachment = (BlittableJsonReaderObject)attachments[i];
                results[i] = JsonDeserializationClient.AttachmentName(attachment);
            }
            return(results);
        }
        public AttachmentName[] GetNames(object entity)
        {
            if (entity == null ||
                DocumentsByEntity.TryGetValue(entity, out DocumentInfo document) == false ||
                document.Metadata.TryGet(Constants.Documents.Metadata.Attachments, out BlittableJsonReaderArray attachments) == false)
            {
                return(Array.Empty <AttachmentName>());
            }

            var results = new AttachmentName[attachments.Length];

            for (var i = 0; i < attachments.Length; i++)
            {
                var attachment = (BlittableJsonReaderObject)attachments[i];
                results[i] = JsonDeserializationClient.AttachmentName(attachment);
            }
            return(results);
        }