mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
- 修复 repository/dbset AddRange AuditValue IEnumable 失败的 bug;#1545
This commit is contained in:
parent
cdd11f6079
commit
6f94377652
@ -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)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user