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
5150aee5
Commit
5150aee5
authored
Dec 29, 2019
by
Savorboard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace `CapTransactionBase` with `ICapTransaction` where transactions are used. #471
parent
1c43afb0
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
12 additions
and
12 deletions
+12
-12
CAP.InMemoryCapOptionsExtension.cs
...re.CAP.InMemoryStorage/CAP.InMemoryCapOptionsExtension.cs
+1
-1
CAP.MongoDBCapOptionsExtension.cs
src/DotNetCore.CAP.MongoDB/CAP.MongoDBCapOptionsExtension.cs
+1
-1
ICapTransaction.MongoDB.cs
src/DotNetCore.CAP.MongoDB/ICapTransaction.MongoDB.cs
+1
-1
CAP.MySqlCapOptionsExtension.cs
src/DotNetCore.CAP.MySql/CAP.MySqlCapOptionsExtension.cs
+1
-1
ICapTransaction.MySql.cs
src/DotNetCore.CAP.MySql/ICapTransaction.MySql.cs
+2
-2
CAP.PostgreSqlCapOptionsExtension.cs
...tCore.CAP.PostgreSql/CAP.PostgreSqlCapOptionsExtension.cs
+1
-1
ICapTransaction.PostgreSql.cs
src/DotNetCore.CAP.PostgreSql/ICapTransaction.PostgreSql.cs
+2
-2
CAP.SqlServerCapOptionsExtension.cs
...NetCore.CAP.SqlServer/CAP.SqlServerCapOptionsExtension.cs
+1
-1
ICapTransaction.SqlServer.cs
src/DotNetCore.CAP.SqlServer/ICapTransaction.SqlServer.cs
+2
-2
No files found.
src/DotNetCore.CAP.InMemoryStorage/CAP.InMemoryCapOptionsExtension.cs
View file @
5150aee5
...
...
@@ -14,7 +14,7 @@ namespace DotNetCore.CAP
{
services
.
AddSingleton
<
CapStorageMarkerService
>();
services
.
AddTransient
<
CapTransactionBase
,
InMemoryCapTransaction
>();
services
.
AddTransient
<
ICapTransaction
,
InMemoryCapTransaction
>();
services
.
AddSingleton
<
IDataStorage
,
InMemoryStorage
.
InMemoryStorage
>();
services
.
AddSingleton
<
IStorageInitializer
,
InMemoryStorageInitializer
>();
}
...
...
src/DotNetCore.CAP.MongoDB/CAP.MongoDBCapOptionsExtension.cs
View file @
5150aee5
...
...
@@ -27,7 +27,7 @@ namespace DotNetCore.CAP.MongoDB
services
.
AddSingleton
<
IDataStorage
,
MongoDBDataStorage
>();
services
.
AddSingleton
<
IStorageInitializer
,
MongoDBStorageInitializer
>();
services
.
AddTransient
<
CapTransactionBase
,
MongoDBCapTransaction
>();
services
.
AddTransient
<
ICapTransaction
,
MongoDBCapTransaction
>();
services
.
Configure
(
_configure
);
...
...
src/DotNetCore.CAP.MongoDB/ICapTransaction.MongoDB.cs
View file @
5150aee5
...
...
@@ -81,7 +81,7 @@ namespace DotNetCore.CAP
ICapPublisher
publisher
,
bool
autoCommit
=
false
)
{
var
clientSessionHandle
=
client
.
StartSession
();
publisher
.
Transaction
.
Value
=
publisher
.
ServiceProvider
.
GetService
<
CapTransactionBase
>();
publisher
.
Transaction
.
Value
=
publisher
.
ServiceProvider
.
GetService
<
ICapTransaction
>();
var
capTrans
=
publisher
.
Transaction
.
Value
.
Begin
(
clientSessionHandle
,
autoCommit
);
return
new
CapMongoDbClientSessionHandle
(
capTrans
);
}
...
...
src/DotNetCore.CAP.MySql/CAP.MySqlCapOptionsExtension.cs
View file @
5150aee5
...
...
@@ -26,7 +26,7 @@ namespace DotNetCore.CAP
services
.
AddSingleton
<
IDataStorage
,
MySqlDataStorage
>();
services
.
TryAddSingleton
<
IStorageInitializer
,
MySqlStorageInitializer
>();
services
.
AddTransient
<
CapTransactionBase
,
MySqlCapTransaction
>();
services
.
AddTransient
<
ICapTransaction
,
MySqlCapTransaction
>();
//Add MySqlOptions
services
.
Configure
(
_configure
);
...
...
src/DotNetCore.CAP.MySql/ICapTransaction.MySql.cs
View file @
5150aee5
...
...
@@ -120,7 +120,7 @@ namespace DotNetCore.CAP
ICapPublisher
publisher
,
bool
autoCommit
=
false
)
{
var
trans
=
database
.
BeginTransaction
();
publisher
.
Transaction
.
Value
=
publisher
.
ServiceProvider
.
GetService
<
CapTransactionBase
>();
publisher
.
Transaction
.
Value
=
publisher
.
ServiceProvider
.
GetService
<
ICapTransaction
>();
var
capTrans
=
publisher
.
Transaction
.
Value
.
Begin
(
trans
,
autoCommit
);
return
new
CapEFDbTransaction
(
capTrans
);
}
...
...
@@ -141,7 +141,7 @@ namespace DotNetCore.CAP
}
var
dbTransaction
=
dbConnection
.
BeginTransaction
();
publisher
.
Transaction
.
Value
=
publisher
.
ServiceProvider
.
GetService
<
CapTransactionBase
>();
publisher
.
Transaction
.
Value
=
publisher
.
ServiceProvider
.
GetService
<
ICapTransaction
>();
return
publisher
.
Transaction
.
Value
.
Begin
(
dbTransaction
,
autoCommit
);
}
}
...
...
src/DotNetCore.CAP.PostgreSql/CAP.PostgreSqlCapOptionsExtension.cs
View file @
5150aee5
...
...
@@ -27,7 +27,7 @@ namespace DotNetCore.CAP
services
.
AddSingleton
<
IDataStorage
,
PostgreSqlDataStorage
>();
services
.
AddSingleton
<
IStorageInitializer
,
PostgreSqlStorageInitializer
>();
services
.
AddTransient
<
CapTransactionBase
,
PostgreSqlCapTransaction
>();
services
.
AddTransient
<
ICapTransaction
,
PostgreSqlCapTransaction
>();
}
}
}
\ No newline at end of file
src/DotNetCore.CAP.PostgreSql/ICapTransaction.PostgreSql.cs
View file @
5150aee5
...
...
@@ -123,7 +123,7 @@ namespace DotNetCore.CAP
if
(
dbConnection
.
State
==
ConnectionState
.
Closed
)
dbConnection
.
Open
();
var
dbTransaction
=
dbConnection
.
BeginTransaction
();
publisher
.
Transaction
.
Value
=
publisher
.
ServiceProvider
.
GetService
<
CapTransactionBase
>();
publisher
.
Transaction
.
Value
=
publisher
.
ServiceProvider
.
GetService
<
ICapTransaction
>();
return
publisher
.
Transaction
.
Value
.
Begin
(
dbTransaction
,
autoCommit
);
}
...
...
@@ -138,7 +138,7 @@ namespace DotNetCore.CAP
ICapPublisher
publisher
,
bool
autoCommit
=
false
)
{
var
trans
=
database
.
BeginTransaction
();
publisher
.
Transaction
.
Value
=
publisher
.
ServiceProvider
.
GetService
<
CapTransactionBase
>();
publisher
.
Transaction
.
Value
=
publisher
.
ServiceProvider
.
GetService
<
ICapTransaction
>();
var
capTrans
=
publisher
.
Transaction
.
Value
.
Begin
(
trans
,
autoCommit
);
return
new
CapEFDbTransaction
(
capTrans
);
}
...
...
src/DotNetCore.CAP.SqlServer/CAP.SqlServerCapOptionsExtension.cs
View file @
5150aee5
...
...
@@ -29,7 +29,7 @@ namespace DotNetCore.CAP
services
.
AddSingleton
<
DiagnosticProcessorObserver
>();
services
.
AddSingleton
<
IDataStorage
,
SqlServerDataStorage
>();
services
.
AddSingleton
<
IStorageInitializer
,
SqlServerStorageInitializer
>();
services
.
AddTransient
<
CapTransactionBase
,
SqlServerCapTransaction
>();
services
.
AddTransient
<
ICapTransaction
,
SqlServerCapTransaction
>();
services
.
TryAddEnumerable
(
ServiceDescriptor
.
Singleton
<
IProcessingServer
,
DiagnosticRegister
>());
services
.
Configure
(
_configure
);
...
...
src/DotNetCore.CAP.SqlServer/ICapTransaction.SqlServer.cs
View file @
5150aee5
...
...
@@ -165,7 +165,7 @@ namespace DotNetCore.CAP
if
(
dbConnection
.
State
==
ConnectionState
.
Closed
)
dbConnection
.
Open
();
var
dbTransaction
=
dbConnection
.
BeginTransaction
();
publisher
.
Transaction
.
Value
=
publisher
.
ServiceProvider
.
GetService
<
CapTransactionBase
>();
publisher
.
Transaction
.
Value
=
publisher
.
ServiceProvider
.
GetService
<
ICapTransaction
>();
var
capTransaction
=
publisher
.
Transaction
.
Value
.
Begin
(
dbTransaction
,
autoCommit
);
return
(
IDbTransaction
)
capTransaction
.
DbTransaction
;
}
...
...
@@ -181,7 +181,7 @@ namespace DotNetCore.CAP
ICapPublisher
publisher
,
bool
autoCommit
=
false
)
{
var
trans
=
database
.
BeginTransaction
();
publisher
.
Transaction
.
Value
=
publisher
.
ServiceProvider
.
GetService
<
CapTransactionBase
>();
publisher
.
Transaction
.
Value
=
publisher
.
ServiceProvider
.
GetService
<
ICapTransaction
>();
var
capTrans
=
publisher
.
Transaction
.
Value
.
Begin
(
trans
,
autoCommit
);
return
new
CapEFDbTransaction
(
capTrans
);
}
...
...
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