Skip to content

Commit

Permalink
- 修复 fsql.InsertOrUpdate 在同线程事务模式内使用的 bug #402
Browse files Browse the repository at this point in the history
  • Loading branch information
28810 authored and 28810 committed Aug 3, 2020
1 parent 270085e commit c7cd1cd
Show file tree
Hide file tree
Showing 3 changed files with 157 additions and 188 deletions.
7 changes: 0 additions & 7 deletions FreeSql.DbContext/FreeSql.DbContext.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

332 changes: 151 additions & 181 deletions FreeSql/FreeSql.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions FreeSql/Internal/CommonProvider/InsertOrUpdateProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ public int ExecuteAffrows()
var ss = SplitSourceByIdentityValueIsNull(_source);
try
{
if (_transaction == null)
this.WithTransaction(_orm.Ado.TransactionCurrentThread);

if (_transaction != null)
{
_source = ss.Item1;
Expand Down Expand Up @@ -314,6 +317,9 @@ async public Task<int> ExecuteAffrowsAsync()
var ss = SplitSourceByIdentityValueIsNull(_source);
try
{
if (_transaction == null)
this.WithTransaction(_orm.Ado.TransactionCurrentThread);

if (_transaction != null)
{
_source = ss.Item1;
Expand Down

0 comments on commit c7cd1cd

Please sign in to comment.