Browse Source
Use `targetDbContextType` instead of `TMongoDbContext`.
pull/10663/head
maliming
4 years ago
No known key found for this signature in database
GPG Key ID: 96224957E51C89E
1 changed files with
2 additions and
2 deletions
-
framework/src/Volo.Abp.MongoDB/Volo/Abp/Uow/MongoDB/UnitOfWorkMongoDbContextProvider.cs
|
|
|
@ -70,7 +70,7 @@ namespace Volo.Abp.Uow.MongoDB |
|
|
|
var databaseName = mongoUrl.DatabaseName; |
|
|
|
if (databaseName.IsNullOrWhiteSpace()) |
|
|
|
{ |
|
|
|
databaseName = ConnectionStringNameAttribute.GetConnStringName<TMongoDbContext>(); |
|
|
|
databaseName = ConnectionStringNameAttribute.GetConnStringName(targetDbContextType); |
|
|
|
} |
|
|
|
|
|
|
|
//TODO: Create only single MongoDbClient per connection string in an application (extract MongoClientCache for example).
|
|
|
|
@ -98,7 +98,7 @@ namespace Volo.Abp.Uow.MongoDB |
|
|
|
var databaseName = mongoUrl.DatabaseName; |
|
|
|
if (databaseName.IsNullOrWhiteSpace()) |
|
|
|
{ |
|
|
|
databaseName = ConnectionStringNameAttribute.GetConnStringName<TMongoDbContext>(); |
|
|
|
databaseName = ConnectionStringNameAttribute.GetConnStringName(targetDbContextType); |
|
|
|
} |
|
|
|
|
|
|
|
//TODO: Create only single MongoDbClient per connection string in an application (extract MongoClientCache for example).
|
|
|
|
|