Interface IDelete<T1>
Assembly: FreeSql.dll
Syntax
public interface IDelete<T1>
Type Parameters
Methods
|
Improve this Doc
View Source
AsTable(Func<String, String>)
设置表名规则,可用于分库/分表,参数1:默认表名;返回值:新表名;
Declaration
IDelete<T1> AsTable(Func<string, string> tableRule)
Parameters
Type |
Name |
Description |
System.Func<System.String, System.String> |
tableRule |
|
Returns
|
Improve this Doc
View Source
AsTable(String)
Declaration
IDelete<T1> AsTable(string tableName)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
Returns
|
Improve this Doc
View Source
AsType(Type)
动态Type,在使用 Delete<object> 后使用本方法,指定实体类型
Declaration
IDelete<T1> AsType(Type entityType)
Parameters
Type |
Name |
Description |
System.Type |
entityType |
|
Returns
|
Improve this Doc
View Source
CommandTimeout(Int32)
Declaration
IDelete<T1> CommandTimeout(int timeout)
Parameters
Type |
Name |
Description |
System.Int32 |
timeout |
|
Returns
|
Improve this Doc
View Source
DisableGlobalFilter(String[])
Declaration
IDelete<T1> DisableGlobalFilter(params string[] name)
Parameters
Type |
Name |
Description |
System.String[] |
name |
零个或多个过滤器名字
|
Returns
|
Improve this Doc
View Source
ExecuteAffrows()
Declaration
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
ExecuteAffrowsAsync(CancellationToken)
Declaration
Task<int> ExecuteAffrowsAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
|
Improve this Doc
View Source
ExecuteDeleted()
执行SQL语句,返回被删除的记录
注意:此方法只有 Postgresql/SqlServer 有效果
Declaration
List<T1> ExecuteDeleted()
Returns
Type |
Description |
System.Collections.Generic.List<T1> |
|
|
Improve this Doc
View Source
ExecuteDeletedAsync(CancellationToken)
Declaration
Task<List<T1>> ExecuteDeletedAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Collections.Generic.List<T1>> |
|
|
Improve this Doc
View Source
ToSql()
Declaration
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Where(T1)
Declaration
IDelete<T1> Where(T1 item)
Parameters
Type |
Name |
Description |
T1 |
item |
实体
|
Returns
|
Improve this Doc
View Source
Where(IEnumerable<T1>)
Declaration
IDelete<T1> Where(IEnumerable<T1> items)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T1> |
items |
实体集合
|
Returns
|
Improve this Doc
View Source
Where(Expression<Func<T1, Boolean>>)
lambda表达式条件,仅支持实体基础成员(不包含导航对象)
若想使用导航对象,请使用 ISelect.ToDelete() 方法
Declaration
IDelete<T1> Where(Expression<Func<T1, bool>> exp)
Parameters
Type |
Name |
Description |
System.Linq.Expressions.Expression<System.Func<T1, System.Boolean>> |
exp |
lambda表达式条件
|
Returns
|
Improve this Doc
View Source
Where(String, Object)
原生sql语法条件,Where("id = @id", new { id = 1 })
提示:parms 参数还可以传 Dictionary<string, object>
Declaration
IDelete<T1> Where(string sql, object parms = null)
Parameters
Type |
Name |
Description |
System.String |
sql |
sql语法条件
|
System.Object |
parms |
参数
|
Returns
|
Improve this Doc
View Source
WhereDynamic(Object, Boolean)
传入动态条件,如:主键值 | new[]{主键值1,主键值2} | TEntity1 | new[]{TEntity1,TEntity2} | new{id=1}
Declaration
IDelete<T1> WhereDynamic(object dywhere, bool not = false)
Parameters
Type |
Name |
Description |
System.Object |
dywhere |
主键值、主键值集合、实体、实体集合、匿名对象、匿名对象集合
|
System.Boolean |
not |
是否标识为NOT
|
Returns
|
Improve this Doc
View Source
WhereIf(Boolean, Expression<Func<T1, Boolean>>)
lambda表达式条件,仅支持实体基础成员(不包含导航对象)
若想使用导航对象,请使用 ISelect.ToUpdate() 方法
Declaration
IDelete<T1> WhereIf(bool condition, Expression<Func<T1, bool>> exp)
Parameters
Type |
Name |
Description |
System.Boolean |
condition |
true 时生效
|
System.Linq.Expressions.Expression<System.Func<T1, System.Boolean>> |
exp |
lambda表达式条件
|
Returns
|
Improve this Doc
View Source
WhereIf(Boolean, String, Object)
原生sql语法条件,Where("id = @id", new { id = 1 })
提示:parms 参数还可以传 Dictionary<string, object>
Declaration
IDelete<T1> WhereIf(bool condition, string sql, object parms = null)
Parameters
Type |
Name |
Description |
System.Boolean |
condition |
true 时生效
|
System.String |
sql |
sql语法条件
|
System.Object |
parms |
参数
|
Returns
|
Improve this Doc
View Source
WithConnection(DbConnection)
Declaration
IDelete<T1> WithConnection(DbConnection connection)
Parameters
Type |
Name |
Description |
System.Data.Common.DbConnection |
connection |
|
Returns
|
Improve this Doc
View Source
WithTransaction(DbTransaction)
Declaration
IDelete<T1> WithTransaction(DbTransaction transaction)
Parameters
Type |
Name |
Description |
System.Data.Common.DbTransaction |
transaction |
|
Returns