Browse Source
Merge pull request #10663 from abpframework/maliming/ConnectionStringNameAttribute
Use `targetDbContextType` instead of `TMongoDbContext`.
pull/10670/head
Halil İbrahim Kalkan
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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).
|
|
|
|
|