Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CAP
Commits
9f6b0e5d
Commit
9f6b0e5d
authored
Sep 29, 2017
by
Savorboard
Browse files
Options
Browse Files
Download
Plain Diff
resolve version conflicts
parents
8d564cde
8744532f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
CAP.MySqlCapOptionsExtension.cs
src/DotNetCore.CAP.MySql/CAP.MySqlCapOptionsExtension.cs
+7
-3
CAP.PostgreSqlCapOptionsExtension.cs
...tCore.CAP.PostgreSql/CAP.PostgreSqlCapOptionsExtension.cs
+7
-3
No files found.
src/DotNetCore.CAP.MySql/CAP.MySqlCapOptionsExtension.cs
View file @
9f6b0e5d
...
...
@@ -32,9 +32,13 @@ namespace DotNetCore.CAP
{
services
.
AddSingleton
(
x
=>
{
var
dbContext
=
(
DbContext
)
x
.
GetService
(
mysqlOptions
.
DbContextType
);
mysqlOptions
.
ConnectionString
=
dbContext
.
Database
.
GetDbConnection
().
ConnectionString
;
return
mysqlOptions
;
using
(
var
scope
=
x
.
CreateScope
())
{
var
provider
=
scope
.
ServiceProvider
;
var
dbContext
=
(
DbContext
)
provider
.
GetService
(
mysqlOptions
.
DbContextType
);
mysqlOptions
.
ConnectionString
=
dbContext
.
Database
.
GetDbConnection
().
ConnectionString
;
return
mysqlOptions
;
}
});
}
else
...
...
src/DotNetCore.CAP.PostgreSql/CAP.PostgreSqlCapOptionsExtension.cs
View file @
9f6b0e5d
...
...
@@ -32,9 +32,13 @@ namespace DotNetCore.CAP
{
services
.
AddSingleton
(
x
=>
{
var
dbContext
=
(
DbContext
)
x
.
GetService
(
postgreSqlOptions
.
DbContextType
);
postgreSqlOptions
.
ConnectionString
=
dbContext
.
Database
.
GetDbConnection
().
ConnectionString
;
return
postgreSqlOptions
;
using
(
var
scope
=
x
.
CreateScope
())
{
var
provider
=
scope
.
ServiceProvider
;
var
dbContext
=
(
DbContext
)
provider
.
GetService
(
postgreSqlOptions
.
DbContextType
);
postgreSqlOptions
.
ConnectionString
=
dbContext
.
Database
.
GetDbConnection
().
ConnectionString
;
return
postgreSqlOptions
;
}
});
}
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment