- 增加 Async CancellationToken IDelete;

This commit is contained in:
2881099
2020-11-12 06:43:45 +08:00
parent 8bbb7329f9
commit 37cd18d7c4
20 changed files with 51 additions and 48 deletions

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace FreeSql.Odbc.Dameng
@ -22,7 +23,7 @@ namespace FreeSql.Odbc.Dameng
#if net40
#else
public override Task<List<T1>> ExecuteDeletedAsync()
public override Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default)
{
throw new NotImplementedException();
}

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace FreeSql.Odbc.Default
@ -19,7 +20,7 @@ namespace FreeSql.Odbc.Default
#if net40
#else
public override Task<List<T1>> ExecuteDeletedAsync() => throw new NotImplementedException("FreeSql.Odbc.Default 未实现该功能");
public override Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException("FreeSql.Odbc.Default 未实现该功能");
#endif
}
}

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace FreeSql.Odbc.KingbaseES
@ -56,7 +57,7 @@ namespace FreeSql.Odbc.KingbaseES
#if net40
#else
async public override Task<List<T1>> ExecuteDeletedAsync()
async public override Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default)
{
var sql = this.ToSql();
if (string.IsNullOrEmpty(sql)) return new List<T1>();
@ -79,7 +80,7 @@ namespace FreeSql.Odbc.KingbaseES
Exception exception = null;
try
{
ret = await _orm.Ado.QueryAsync<T1>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ret = await _orm.Ado.QueryAsync<T1>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
}
catch (Exception ex)
{

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace FreeSql.Odbc.MySql
@ -56,7 +57,7 @@ namespace FreeSql.Odbc.MySql
#if net40
#else
async public override Task<List<T1>> ExecuteDeletedAsync()
async public override Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default)
{
var sql = this.ToSql();
if (string.IsNullOrEmpty(sql)) return new List<T1>();
@ -79,7 +80,7 @@ namespace FreeSql.Odbc.MySql
Exception exception = null;
try
{
ret = await _orm.Ado.QueryAsync<T1>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ret = await _orm.Ado.QueryAsync<T1>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
}
catch (Exception ex)
{

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace FreeSql.Odbc.Oracle
@ -22,7 +23,7 @@ namespace FreeSql.Odbc.Oracle
#if net40
#else
public override Task<List<T1>> ExecuteDeletedAsync()
public override Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default)
{
throw new NotImplementedException();
}

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace FreeSql.Odbc.PostgreSQL
@ -56,7 +57,7 @@ namespace FreeSql.Odbc.PostgreSQL
#if net40
#else
async public override Task<List<T1>> ExecuteDeletedAsync()
async public override Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default)
{
var sql = this.ToSql();
if (string.IsNullOrEmpty(sql)) return new List<T1>();
@ -79,7 +80,7 @@ namespace FreeSql.Odbc.PostgreSQL
Exception exception = null;
try
{
ret = await _orm.Ado.QueryAsync<T1>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ret = await _orm.Ado.QueryAsync<T1>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
}
catch (Exception ex)
{

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace FreeSql.Odbc.SqlServer
@ -61,7 +62,7 @@ namespace FreeSql.Odbc.SqlServer
#if net40
#else
async public override Task<List<T1>> ExecuteDeletedAsync()
async public override Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default)
{
var sql = this.ToSql();
if (string.IsNullOrEmpty(sql)) return new List<T1>();
@ -89,7 +90,7 @@ namespace FreeSql.Odbc.SqlServer
Exception exception = null;
try
{
ret = await _orm.Ado.QueryAsync<T1>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ret = await _orm.Ado.QueryAsync<T1>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
}
catch (Exception ex)
{