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