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
9ef8d4c4
Commit
9ef8d4c4
authored
Jul 25, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issue #16.
parent
e62c8ff5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
CAP.MySqlCapOptionsExtension.cs
src/DotNetCore.CAP.MySql/CAP.MySqlCapOptionsExtension.cs
+3
-4
CAP.SqlServerCapOptionsExtension.cs
...NetCore.CAP.SqlServer/CAP.SqlServerCapOptionsExtension.cs
+3
-4
No files found.
src/DotNetCore.CAP.MySql/CAP.MySqlCapOptionsExtension.cs
View file @
9ef8d4c4
...
@@ -26,14 +26,13 @@ namespace DotNetCore.CAP
...
@@ -26,14 +26,13 @@ namespace DotNetCore.CAP
var
sqlServerOptions
=
new
MySqlOptions
();
var
sqlServerOptions
=
new
MySqlOptions
();
_configure
(
sqlServerOptions
);
_configure
(
sqlServerOptions
);
var
provider
=
TempBuildService
(
services
);
if
(
sqlServerOptions
.
DbContextType
!=
null
)
var
dbContextObj
=
provider
.
GetService
(
sqlServerOptions
.
DbContextType
);
if
(
dbContextObj
!=
null
)
{
{
var
provider
=
TempBuildService
(
services
);
var
dbContextObj
=
provider
.
GetService
(
sqlServerOptions
.
DbContextType
);
var
dbContext
=
(
DbContext
)
dbContextObj
;
var
dbContext
=
(
DbContext
)
dbContextObj
;
sqlServerOptions
.
ConnectionString
=
dbContext
.
Database
.
GetDbConnection
().
ConnectionString
;
sqlServerOptions
.
ConnectionString
=
dbContext
.
Database
.
GetDbConnection
().
ConnectionString
;
}
}
services
.
Configure
(
_configure
);
services
.
AddSingleton
(
sqlServerOptions
);
services
.
AddSingleton
(
sqlServerOptions
);
}
}
...
...
src/DotNetCore.CAP.SqlServer/CAP.SqlServerCapOptionsExtension.cs
View file @
9ef8d4c4
...
@@ -26,14 +26,13 @@ namespace DotNetCore.CAP
...
@@ -26,14 +26,13 @@ namespace DotNetCore.CAP
var
sqlServerOptions
=
new
SqlServerOptions
();
var
sqlServerOptions
=
new
SqlServerOptions
();
_configure
(
sqlServerOptions
);
_configure
(
sqlServerOptions
);
var
provider
=
TempBuildService
(
services
);
if
(
sqlServerOptions
.
DbContextType
!=
null
)
var
dbContextObj
=
provider
.
GetService
(
sqlServerOptions
.
DbContextType
);
if
(
dbContextObj
!=
null
)
{
{
var
provider
=
TempBuildService
(
services
);
var
dbContextObj
=
provider
.
GetService
(
sqlServerOptions
.
DbContextType
);
var
dbContext
=
(
DbContext
)
dbContextObj
;
var
dbContext
=
(
DbContext
)
dbContextObj
;
sqlServerOptions
.
ConnectionString
=
dbContext
.
Database
.
GetDbConnection
().
ConnectionString
;
sqlServerOptions
.
ConnectionString
=
dbContext
.
Database
.
GetDbConnection
().
ConnectionString
;
}
}
services
.
Configure
(
_configure
);
services
.
AddSingleton
(
sqlServerOptions
);
services
.
AddSingleton
(
sqlServerOptions
);
}
}
...
...
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