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
41b983cf
Commit
41b983cf
authored
Jul 25, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct spelling mistakes.
parent
a1561bd2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
18 deletions
+18
-18
CAP.MySqlCapOptionsExtension.cs
src/DotNetCore.CAP.MySql/CAP.MySqlCapOptionsExtension.cs
+6
-6
CapPublisher.cs
src/DotNetCore.CAP.MySql/CapPublisher.cs
+5
-5
IAdditionalProcessor.Default.cs
src/DotNetCore.CAP.MySql/IAdditionalProcessor.Default.cs
+2
-2
CapPublisher.cs
src/DotNetCore.CAP.SqlServer/CapPublisher.cs
+5
-5
No files found.
src/DotNetCore.CAP.MySql/CAP.MySqlCapOptionsExtension.cs
View file @
41b983cf
...
@@ -23,17 +23,17 @@ namespace DotNetCore.CAP
...
@@ -23,17 +23,17 @@ namespace DotNetCore.CAP
services
.
AddScoped
<
ICapPublisher
,
CapPublisher
>();
services
.
AddScoped
<
ICapPublisher
,
CapPublisher
>();
services
.
AddTransient
<
IAdditionalProcessor
,
DefaultAdditionalProcessor
>();
services
.
AddTransient
<
IAdditionalProcessor
,
DefaultAdditionalProcessor
>();
var
sqlServer
Options
=
new
MySqlOptions
();
var
mysql
Options
=
new
MySqlOptions
();
_configure
(
sqlServer
Options
);
_configure
(
mysql
Options
);
if
(
sqlServer
Options
.
DbContextType
!=
null
)
if
(
mysql
Options
.
DbContextType
!=
null
)
{
{
var
provider
=
TempBuildService
(
services
);
var
provider
=
TempBuildService
(
services
);
var
dbContextObj
=
provider
.
GetService
(
sqlServer
Options
.
DbContextType
);
var
dbContextObj
=
provider
.
GetService
(
mysql
Options
.
DbContextType
);
var
dbContext
=
(
DbContext
)
dbContextObj
;
var
dbContext
=
(
DbContext
)
dbContextObj
;
sqlServer
Options
.
ConnectionString
=
dbContext
.
Database
.
GetDbConnection
().
ConnectionString
;
mysql
Options
.
ConnectionString
=
dbContext
.
Database
.
GetDbConnection
().
ConnectionString
;
}
}
services
.
AddSingleton
(
sqlServer
Options
);
services
.
AddSingleton
(
mysql
Options
);
}
}
private
IServiceProvider
TempBuildService
(
IServiceCollection
services
)
private
IServiceProvider
TempBuildService
(
IServiceCollection
services
)
...
...
src/DotNetCore.CAP.MySql/CapPublisher.cs
View file @
41b983cf
...
@@ -74,7 +74,7 @@ namespace DotNetCore.CAP.MySql
...
@@ -74,7 +74,7 @@ namespace DotNetCore.CAP.MySql
{
{
CheckIsAdoNet
(
name
);
CheckIsAdoNet
(
name
);
Pre
P
areConnection
(
dbConnection
,
ref
dbTransaction
);
Pre
p
areConnection
(
dbConnection
,
ref
dbTransaction
);
PublishWithTrans
(
name
,
content
,
dbConnection
,
dbTransaction
);
PublishWithTrans
(
name
,
content
,
dbConnection
,
dbTransaction
);
}
}
...
@@ -83,7 +83,7 @@ namespace DotNetCore.CAP.MySql
...
@@ -83,7 +83,7 @@ namespace DotNetCore.CAP.MySql
{
{
CheckIsAdoNet
(
name
);
CheckIsAdoNet
(
name
);
Pre
P
areConnection
(
dbConnection
,
ref
dbTransaction
);
Pre
p
areConnection
(
dbConnection
,
ref
dbTransaction
);
return
PublishWithTransAsync
(
name
,
content
,
dbConnection
,
dbTransaction
);
return
PublishWithTransAsync
(
name
,
content
,
dbConnection
,
dbTransaction
);
}
}
...
@@ -92,7 +92,7 @@ namespace DotNetCore.CAP.MySql
...
@@ -92,7 +92,7 @@ namespace DotNetCore.CAP.MySql
{
{
CheckIsAdoNet
(
name
);
CheckIsAdoNet
(
name
);
Pre
P
areConnection
(
dbConnection
,
ref
dbTransaction
);
Pre
p
areConnection
(
dbConnection
,
ref
dbTransaction
);
var
content
=
Helper
.
ToJson
(
contentObj
);
var
content
=
Helper
.
ToJson
(
contentObj
);
...
@@ -103,7 +103,7 @@ namespace DotNetCore.CAP.MySql
...
@@ -103,7 +103,7 @@ namespace DotNetCore.CAP.MySql
{
{
CheckIsAdoNet
(
name
);
CheckIsAdoNet
(
name
);
Pre
P
areConnection
(
dbConnection
,
ref
dbTransaction
);
Pre
p
areConnection
(
dbConnection
,
ref
dbTransaction
);
var
content
=
Helper
.
ToJson
(
contentObj
);
var
content
=
Helper
.
ToJson
(
contentObj
);
...
@@ -112,7 +112,7 @@ namespace DotNetCore.CAP.MySql
...
@@ -112,7 +112,7 @@ namespace DotNetCore.CAP.MySql
#
region
private
methods
#
region
private
methods
private
void
Pre
P
areConnection
(
IDbConnection
dbConnection
,
ref
IDbTransaction
dbTransaction
)
private
void
Pre
p
areConnection
(
IDbConnection
dbConnection
,
ref
IDbTransaction
dbTransaction
)
{
{
if
(
dbConnection
==
null
)
if
(
dbConnection
==
null
)
throw
new
ArgumentNullException
(
nameof
(
dbConnection
));
throw
new
ArgumentNullException
(
nameof
(
dbConnection
));
...
...
src/DotNetCore.CAP.MySql/IAdditionalProcessor.Default.cs
View file @
41b983cf
...
@@ -21,11 +21,11 @@ namespace DotNetCore.CAP.MySql
...
@@ -21,11 +21,11 @@ namespace DotNetCore.CAP.MySql
public
DefaultAdditionalProcessor
(
public
DefaultAdditionalProcessor
(
IServiceProvider
provider
,
IServiceProvider
provider
,
ILogger
<
DefaultAdditionalProcessor
>
logger
,
ILogger
<
DefaultAdditionalProcessor
>
logger
,
MySqlOptions
sqlServer
Options
)
MySqlOptions
mysql
Options
)
{
{
_logger
=
logger
;
_logger
=
logger
;
_provider
=
provider
;
_provider
=
provider
;
_options
=
sqlServer
Options
;
_options
=
mysql
Options
;
}
}
public
async
Task
ProcessAsync
(
ProcessingContext
context
)
public
async
Task
ProcessAsync
(
ProcessingContext
context
)
...
...
src/DotNetCore.CAP.SqlServer/CapPublisher.cs
View file @
41b983cf
...
@@ -73,7 +73,7 @@ namespace DotNetCore.CAP.SqlServer
...
@@ -73,7 +73,7 @@ namespace DotNetCore.CAP.SqlServer
public
void
Publish
(
string
name
,
string
content
,
IDbConnection
dbConnection
,
IDbTransaction
dbTransaction
=
null
)
public
void
Publish
(
string
name
,
string
content
,
IDbConnection
dbConnection
,
IDbTransaction
dbTransaction
=
null
)
{
{
CheckIsAdoNet
(
name
);
CheckIsAdoNet
(
name
);
Pre
P
areConnection
(
dbConnection
,
ref
dbTransaction
);
Pre
p
areConnection
(
dbConnection
,
ref
dbTransaction
);
PublishWithTrans
(
name
,
content
,
dbConnection
,
dbTransaction
);
PublishWithTrans
(
name
,
content
,
dbConnection
,
dbTransaction
);
}
}
...
@@ -81,7 +81,7 @@ namespace DotNetCore.CAP.SqlServer
...
@@ -81,7 +81,7 @@ namespace DotNetCore.CAP.SqlServer
public
Task
PublishAsync
(
string
name
,
string
content
,
IDbConnection
dbConnection
,
IDbTransaction
dbTransaction
=
null
)
public
Task
PublishAsync
(
string
name
,
string
content
,
IDbConnection
dbConnection
,
IDbTransaction
dbTransaction
=
null
)
{
{
CheckIsAdoNet
(
name
);
CheckIsAdoNet
(
name
);
Pre
P
areConnection
(
dbConnection
,
ref
dbTransaction
);
Pre
p
areConnection
(
dbConnection
,
ref
dbTransaction
);
return
PublishWithTransAsync
(
name
,
content
,
dbConnection
,
dbTransaction
);
return
PublishWithTransAsync
(
name
,
content
,
dbConnection
,
dbTransaction
);
}
}
...
@@ -89,7 +89,7 @@ namespace DotNetCore.CAP.SqlServer
...
@@ -89,7 +89,7 @@ namespace DotNetCore.CAP.SqlServer
public
void
Publish
<
T
>(
string
name
,
T
contentObj
,
IDbConnection
dbConnection
,
IDbTransaction
dbTransaction
=
null
)
public
void
Publish
<
T
>(
string
name
,
T
contentObj
,
IDbConnection
dbConnection
,
IDbTransaction
dbTransaction
=
null
)
{
{
CheckIsAdoNet
(
name
);
CheckIsAdoNet
(
name
);
Pre
P
areConnection
(
dbConnection
,
ref
dbTransaction
);
Pre
p
areConnection
(
dbConnection
,
ref
dbTransaction
);
var
content
=
Helper
.
ToJson
(
contentObj
);
var
content
=
Helper
.
ToJson
(
contentObj
);
...
@@ -99,7 +99,7 @@ namespace DotNetCore.CAP.SqlServer
...
@@ -99,7 +99,7 @@ namespace DotNetCore.CAP.SqlServer
public
Task
PublishAsync
<
T
>(
string
name
,
T
contentObj
,
IDbConnection
dbConnection
,
IDbTransaction
dbTransaction
=
null
)
public
Task
PublishAsync
<
T
>(
string
name
,
T
contentObj
,
IDbConnection
dbConnection
,
IDbTransaction
dbTransaction
=
null
)
{
{
CheckIsAdoNet
(
name
);
CheckIsAdoNet
(
name
);
Pre
P
areConnection
(
dbConnection
,
ref
dbTransaction
);
Pre
p
areConnection
(
dbConnection
,
ref
dbTransaction
);
var
content
=
Helper
.
ToJson
(
contentObj
);
var
content
=
Helper
.
ToJson
(
contentObj
);
...
@@ -108,7 +108,7 @@ namespace DotNetCore.CAP.SqlServer
...
@@ -108,7 +108,7 @@ namespace DotNetCore.CAP.SqlServer
#
region
private
methods
#
region
private
methods
private
void
Pre
P
areConnection
(
IDbConnection
dbConnection
,
ref
IDbTransaction
dbTransaction
)
private
void
Pre
p
areConnection
(
IDbConnection
dbConnection
,
ref
IDbTransaction
dbTransaction
)
{
{
if
(
dbConnection
==
null
)
if
(
dbConnection
==
null
)
throw
new
ArgumentNullException
(
nameof
(
dbConnection
));
throw
new
ArgumentNullException
(
nameof
(
dbConnection
));
...
...
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