Bug in class DocumentDbRepository.cs. Line 37 must be executed before line 35, otherwise an Exception will be thrown in method GetOrCreateCollectionAsync() line 189: collection = await _client.CreateDocumentCollectionAsync((await _database).SelfLink, collection); because collection is always null.