mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 17:20:49 +08:00 
			
		
		
		
	- 修复 repository/dbset AddRange AuditValue IEnumable 失败的 bug;#1545
This commit is contained in:
		@@ -96,6 +96,7 @@ namespace FreeSql
 | 
				
			|||||||
        public Task AddAsync(TEntity data, CancellationToken cancellationToken = default) => AddPrivAsync(data, true, cancellationToken);
 | 
					        public Task AddAsync(TEntity data, CancellationToken cancellationToken = default) => AddPrivAsync(data, true, cancellationToken);
 | 
				
			||||||
        async public Task AddRangeAsync(IEnumerable<TEntity> data, CancellationToken cancellationToken = default)
 | 
					        async public Task AddRangeAsync(IEnumerable<TEntity> data, CancellationToken cancellationToken = default)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					            if (data is List<TEntity> == false) data = data?.ToList();
 | 
				
			||||||
            if (CanAdd(data, true) == false) return;
 | 
					            if (CanAdd(data, true) == false) return;
 | 
				
			||||||
            if (data.ElementAtOrDefault(1) == default(TEntity))
 | 
					            if (data.ElementAtOrDefault(1) == default(TEntity))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
@@ -444,6 +445,7 @@ namespace FreeSql
 | 
				
			|||||||
        public Task UpdateRangeAsync(IEnumerable<TEntity> data, CancellationToken cancellationToken = default) => UpdateRangePrivAsync(data, true, cancellationToken);
 | 
					        public Task UpdateRangeAsync(IEnumerable<TEntity> data, CancellationToken cancellationToken = default) => UpdateRangePrivAsync(data, true, cancellationToken);
 | 
				
			||||||
        async Task UpdateRangePrivAsync(IEnumerable<TEntity> data, bool isCheck, CancellationToken cancellationToken)
 | 
					        async Task UpdateRangePrivAsync(IEnumerable<TEntity> data, bool isCheck, CancellationToken cancellationToken)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					            if (data is List<TEntity> == false) data = data?.ToList();
 | 
				
			||||||
            if (CanUpdate(data, true) == false) return;
 | 
					            if (CanUpdate(data, true) == false) return;
 | 
				
			||||||
            foreach (var item in data)
 | 
					            foreach (var item in data)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -98,6 +98,7 @@ namespace FreeSql
 | 
				
			|||||||
        public void Add(TEntity data) => AddPriv(data, true);
 | 
					        public void Add(TEntity data) => AddPriv(data, true);
 | 
				
			||||||
        public void AddRange(IEnumerable<TEntity> data)
 | 
					        public void AddRange(IEnumerable<TEntity> data)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					            if (data is List<TEntity> == false) data = data?.ToList();
 | 
				
			||||||
            if (CanAdd(data, true) == false) return;
 | 
					            if (CanAdd(data, true) == false) return;
 | 
				
			||||||
            if (data.ElementAtOrDefault(1) == default(TEntity))
 | 
					            if (data.ElementAtOrDefault(1) == default(TEntity))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
@@ -484,6 +485,7 @@ namespace FreeSql
 | 
				
			|||||||
        public void UpdateRange(IEnumerable<TEntity> data) => UpdateRangePriv(data, true);
 | 
					        public void UpdateRange(IEnumerable<TEntity> data) => UpdateRangePriv(data, true);
 | 
				
			||||||
        void UpdateRangePriv(IEnumerable<TEntity> data, bool isCheck)
 | 
					        void UpdateRangePriv(IEnumerable<TEntity> data, bool isCheck)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					            if (data is List<TEntity> == false) data = data?.ToList();
 | 
				
			||||||
            if (CanUpdate(data, true) == false) return;
 | 
					            if (CanUpdate(data, true) == false) return;
 | 
				
			||||||
            foreach (var item in data)
 | 
					            foreach (var item in data)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user