mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
- 修复 IInsert/IUpdate BatchProgress 异步执行不生效的 bug;
This commit is contained in:
parent
db42c5cd9d
commit
dcb4fef9e2
@ -27,6 +27,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
}
|
}
|
||||||
if (ss.Length == 1)
|
if (ss.Length == 1)
|
||||||
{
|
{
|
||||||
|
_batchProgress?.Invoke(new BatchProgressStatus<T1>(_source, 1, 1));
|
||||||
ret = await this.RawExecuteAffrowsAsync();
|
ret = await this.RawExecuteAffrowsAsync();
|
||||||
ClearData();
|
ClearData();
|
||||||
return ret;
|
return ret;
|
||||||
@ -43,7 +44,8 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
{
|
{
|
||||||
for (var a = 0; a < ss.Length; a++)
|
for (var a = 0; a < ss.Length; a++)
|
||||||
{
|
{
|
||||||
_source = ss[a];
|
_source = ss[a];
|
||||||
|
_batchProgress?.Invoke(new BatchProgressStatus<T1>(_source, a + 1, ss.Length));
|
||||||
ret += await this.RawExecuteAffrowsAsync();
|
ret += await this.RawExecuteAffrowsAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -59,6 +61,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
for (var a = 0; a < ss.Length; a++)
|
for (var a = 0; a < ss.Length; a++)
|
||||||
{
|
{
|
||||||
_source = ss[a];
|
_source = ss[a];
|
||||||
|
_batchProgress?.Invoke(new BatchProgressStatus<T1>(_source, a + 1, ss.Length));
|
||||||
ret += await this.RawExecuteAffrowsAsync();
|
ret += await this.RawExecuteAffrowsAsync();
|
||||||
}
|
}
|
||||||
_transaction.Commit();
|
_transaction.Commit();
|
||||||
@ -99,6 +102,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
}
|
}
|
||||||
if (ss.Length == 1)
|
if (ss.Length == 1)
|
||||||
{
|
{
|
||||||
|
_batchProgress?.Invoke(new BatchProgressStatus<T1>(_source, 1, 1));
|
||||||
ret = await this.RawExecuteIdentityAsync();
|
ret = await this.RawExecuteIdentityAsync();
|
||||||
ClearData();
|
ClearData();
|
||||||
return ret;
|
return ret;
|
||||||
@ -116,6 +120,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
for (var a = 0; a < ss.Length; a++)
|
for (var a = 0; a < ss.Length; a++)
|
||||||
{
|
{
|
||||||
_source = ss[a];
|
_source = ss[a];
|
||||||
|
_batchProgress?.Invoke(new BatchProgressStatus<T1>(_source, a + 1, ss.Length));
|
||||||
if (a < ss.Length - 1) await this.RawExecuteAffrowsAsync();
|
if (a < ss.Length - 1) await this.RawExecuteAffrowsAsync();
|
||||||
else ret = await this.RawExecuteIdentityAsync();
|
else ret = await this.RawExecuteIdentityAsync();
|
||||||
}
|
}
|
||||||
@ -132,6 +137,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
for (var a = 0; a < ss.Length; a++)
|
for (var a = 0; a < ss.Length; a++)
|
||||||
{
|
{
|
||||||
_source = ss[a];
|
_source = ss[a];
|
||||||
|
_batchProgress?.Invoke(new BatchProgressStatus<T1>(_source, a + 1, ss.Length));
|
||||||
if (a < ss.Length - 1) await this.RawExecuteAffrowsAsync();
|
if (a < ss.Length - 1) await this.RawExecuteAffrowsAsync();
|
||||||
else ret = await this.RawExecuteIdentityAsync();
|
else ret = await this.RawExecuteIdentityAsync();
|
||||||
}
|
}
|
||||||
@ -173,6 +179,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
}
|
}
|
||||||
if (ss.Length == 1)
|
if (ss.Length == 1)
|
||||||
{
|
{
|
||||||
|
_batchProgress?.Invoke(new BatchProgressStatus<T1>(_source, 1, 1));
|
||||||
ret = await this.RawExecuteInsertedAsync();
|
ret = await this.RawExecuteInsertedAsync();
|
||||||
ClearData();
|
ClearData();
|
||||||
return ret;
|
return ret;
|
||||||
@ -189,7 +196,8 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
{
|
{
|
||||||
for (var a = 0; a < ss.Length; a++)
|
for (var a = 0; a < ss.Length; a++)
|
||||||
{
|
{
|
||||||
_source = ss[a];
|
_source = ss[a];
|
||||||
|
_batchProgress?.Invoke(new BatchProgressStatus<T1>(_source, a + 1, ss.Length));
|
||||||
ret.AddRange(await this.RawExecuteInsertedAsync());
|
ret.AddRange(await this.RawExecuteInsertedAsync());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -205,6 +213,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
for (var a = 0; a < ss.Length; a++)
|
for (var a = 0; a < ss.Length; a++)
|
||||||
{
|
{
|
||||||
_source = ss[a];
|
_source = ss[a];
|
||||||
|
_batchProgress?.Invoke(new BatchProgressStatus<T1>(_source, a + 1, ss.Length));
|
||||||
ret.AddRange(await this.RawExecuteInsertedAsync());
|
ret.AddRange(await this.RawExecuteInsertedAsync());
|
||||||
}
|
}
|
||||||
_transaction.Commit();
|
_transaction.Commit();
|
||||||
|
@ -23,6 +23,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
var ret = 0;
|
var ret = 0;
|
||||||
if (ss.Length <= 1)
|
if (ss.Length <= 1)
|
||||||
{
|
{
|
||||||
|
if (_source?.Any() == true) _batchProgress?.Invoke(new BatchProgressStatus<T1>(_source, 1, 1));
|
||||||
ret = await this.RawExecuteAffrowsAsync();
|
ret = await this.RawExecuteAffrowsAsync();
|
||||||
ClearData();
|
ClearData();
|
||||||
return ret;
|
return ret;
|
||||||
@ -40,6 +41,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
for (var a = 0; a < ss.Length; a++)
|
for (var a = 0; a < ss.Length; a++)
|
||||||
{
|
{
|
||||||
_source = ss[a];
|
_source = ss[a];
|
||||||
|
_batchProgress?.Invoke(new BatchProgressStatus<T1>(_source, a + 1, ss.Length));
|
||||||
ret += await this.RawExecuteAffrowsAsync();
|
ret += await this.RawExecuteAffrowsAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -55,6 +57,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
for (var a = 0; a < ss.Length; a++)
|
for (var a = 0; a < ss.Length; a++)
|
||||||
{
|
{
|
||||||
_source = ss[a];
|
_source = ss[a];
|
||||||
|
_batchProgress?.Invoke(new BatchProgressStatus<T1>(_source, a + 1, ss.Length));
|
||||||
ret += await this.RawExecuteAffrowsAsync();
|
ret += await this.RawExecuteAffrowsAsync();
|
||||||
}
|
}
|
||||||
_transaction.Commit();
|
_transaction.Commit();
|
||||||
@ -89,6 +92,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
var ret = new List<T1>();
|
var ret = new List<T1>();
|
||||||
if (ss.Length <= 1)
|
if (ss.Length <= 1)
|
||||||
{
|
{
|
||||||
|
if (_source?.Any() == true) _batchProgress?.Invoke(new BatchProgressStatus<T1>(_source, 1, 1));
|
||||||
ret = await this.RawExecuteUpdatedAsync();
|
ret = await this.RawExecuteUpdatedAsync();
|
||||||
ClearData();
|
ClearData();
|
||||||
return ret;
|
return ret;
|
||||||
@ -105,7 +109,8 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
{
|
{
|
||||||
for (var a = 0; a < ss.Length; a++)
|
for (var a = 0; a < ss.Length; a++)
|
||||||
{
|
{
|
||||||
_source = ss[a];
|
_source = ss[a];
|
||||||
|
_batchProgress?.Invoke(new BatchProgressStatus<T1>(_source, a + 1, ss.Length));
|
||||||
ret.AddRange(await this.RawExecuteUpdatedAsync());
|
ret.AddRange(await this.RawExecuteUpdatedAsync());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -121,6 +126,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
for (var a = 0; a < ss.Length; a++)
|
for (var a = 0; a < ss.Length; a++)
|
||||||
{
|
{
|
||||||
_source = ss[a];
|
_source = ss[a];
|
||||||
|
_batchProgress?.Invoke(new BatchProgressStatus<T1>(_source, a + 1, ss.Length));
|
||||||
ret.AddRange(await this.RawExecuteUpdatedAsync());
|
ret.AddRange(await this.RawExecuteUpdatedAsync());
|
||||||
}
|
}
|
||||||
_transaction.Commit();
|
_transaction.Commit();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user