/// <summary>
        /// Add an attachment to an entity
        /// </summary>
        /// <param name="id">id of entity</param>
        /// <param name="filePathAttachment">file path of the file to attach</param>
        /// <param name="contentType">type of the file to attach</param>
        /// <param name="attachmentName">identify of the file to attach</param>
        public override void AddAttachment(string id, Stream fileStream, string contentType, string attachmentName)
        {
            var existingEntity = this.database.GetExistingDocument(GetInternalCBLId(id));

            if (existingEntity == null)
            {
                throw new KeyNotFoundNoSQLException();
            }

            IUnsavedRevision newRevision = existingEntity.CurrentRevision.CreateRevision();

            newRevision.SetAttachment(attachmentName, contentType, fileStream);
            newRevision.Save();
        }