public async Task DeleteDocumentAsync(Document document)
        {
            var allDocuments = await _documentsRepository.GetDocumentsAsync();

            var documentsToUpdate = GetInsertionAffectedDocuments(allDocuments, document.Position, allDocuments.Length).ToArray();

            await _documentsRepository.DeleteDocumentAsync(document.Id, documentsToUpdate);

            await _contentStorage.DeleteFile(Path.GetFileName(document.Location));
        }