File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
src/NetCoreKit.Infrastructure.EfCore.MySql Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ namespace NetCoreKit.Infrastructure.EfCore.MySql
6
6
{
7
7
public sealed class DatabaseConnectionStringFactory : IDatabaseConnectionStringFactory
8
8
{
9
- private readonly DbOptions _dbOption ;
9
+ public DbOptions DbOptions { get ; }
10
10
11
11
public DatabaseConnectionStringFactory ( )
12
12
{
13
13
var config = ConfigurationHelper . GetConfiguration ( ) ;
14
14
var dbSection = config . GetSection ( "Features:EfCore:MySqlDb" ) ;
15
- _dbOption = new DbOptions {
15
+ DbOptions = new DbOptions {
16
16
ConnString = dbSection [ "ConnString" ] ,
17
17
FQDN = dbSection [ "FQDN" ] ,
18
18
Database = dbSection [ "Database" ] ,
@@ -24,22 +24,22 @@ public DatabaseConnectionStringFactory()
24
24
25
25
public DatabaseConnectionStringFactory ( IOptions < DbOptions > options )
26
26
{
27
- _dbOption = options . Value ;
27
+ DbOptions = options . Value ;
28
28
}
29
29
30
30
public string Create ( )
31
31
{
32
- var connPattern = _dbOption . ConnString ;
33
- var connConfigs = _dbOption . FQDN ? . Split ( ':' ) ;
32
+ var connPattern = DbOptions . ConnString ;
33
+ var connConfigs = DbOptions . FQDN ? . Split ( ':' ) ;
34
34
var fqdn = connConfigs ? . First ( ) ;
35
35
var port = connConfigs ? . Except ( new [ ] { fqdn } ) . First ( ) ;
36
36
37
37
return string . Format (
38
38
connPattern ,
39
39
fqdn , port ,
40
- _dbOption . UserName ,
41
- _dbOption . Password ,
42
- _dbOption . Database ) ;
40
+ DbOptions . UserName ,
41
+ DbOptions . Password ,
42
+ DbOptions . Database ) ;
43
43
}
44
44
}
45
45
}
You can’t perform that action at this time.
0 commit comments