public async Task EnsureUserCollectionExists <TDocument>(Guid userId, IEnumerable <TDocument> defaultDocuments) { var documentStore = _userStoreCache.GetEntry(userId); using (var session = documentStore.OpenAsyncSession()) { var anyDocumentExists = await session.Query <TDocument>().AnyAsync(); if (anyDocumentExists) { return; } } await _databaseApi.BulkInsertDocuments(documentStore, defaultDocuments); }