public async Task <TDocumentStore> CreateDocumentRepositoryAsync <TDocumentStore>(Tenant tenant) where TDocumentStore : IRepository { if (!_typeMap.ContainsKey(typeof(TDocumentStore))) { new ArgumentOutOfRangeException($"{typeof(TDocumentStore).FullName} is not registered."); } return((TDocumentStore)(await RepositoryExtensions .CreateDocumentRepository(_typeMap[typeof(TDocumentStore)], tenant, this._configStore, this._logFactory) .ConfigureAwait(false))); }