Interface IUpdateJoin<T1, T2>
Namespace: FreeSql
Assembly: FreeSql.dll
Syntax
public interface IUpdateJoin<T1, T2>
Type Parameters
Name | Description |
---|---|
T1 | |
T2 |
Methods
| Improve this Doc View SourceAsTable(String)
设置表名
Declaration
IUpdateJoin<T1, T2> AsTable(string tableName)
Parameters
Type | Name | Description |
---|---|---|
System.String | tableName |
Returns
Type | Description |
---|---|
IUpdateJoin<T1, T2> |
CommandTimeout(Int32)
命令超时设置(秒)
Declaration
IUpdateJoin<T1, T2> CommandTimeout(int timeout)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | timeout |
Returns
Type | Description |
---|---|
IUpdateJoin<T1, T2> |
DisableGlobalFilter(String[])
禁用全局过滤功能,不传参数时将禁用所有
Declaration
IUpdateJoin<T1, T2> DisableGlobalFilter(params string[] name)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | name | 零个或多个过滤器名字 |
Returns
Type | Description |
---|---|
IUpdateJoin<T1, T2> |
ExecuteAffrows()
执行SQL语句,返回影响的行数
Declaration
int ExecuteAffrows()
Returns
Type | Description |
---|---|
System.Int32 |
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> |
Set(Expression<Func<T1, T2, Boolean>>)
设置列的联表值,格式:
Set((a, b) => a.Clicks == b.xxx)
Set((a, b) => a.Clicks == a.Clicks + 1)
Declaration
IUpdateJoin<T1, T2> Set(Expression<Func<T1, T2, bool>> exp)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<T1, T2, System.Boolean>> | exp |
Returns
Type | Description |
---|---|
IUpdateJoin<T1, T2> |
Set<TMember>(Expression<Func<T1, TMember>>, TMember)
设置列的固定新值,Set(a => a.Name, "newvalue")
Declaration
IUpdateJoin<T1, T2> Set<TMember>(Expression<Func<T1, TMember>> column, TMember value)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<T1, TMember>> | column | lambda选择列 |
TMember | value | 新值 |
Returns
Type | Description |
---|---|
IUpdateJoin<T1, T2> |
Type Parameters
Name | Description |
---|---|
TMember |
SetIf(Boolean, Expression<Func<T1, T2, Boolean>>)
设置列的联表值,格式:
Set((a, b) => a.Clicks == b.xxx)
Set((a, b) => a.Clicks == a.Clicks + 1)
Declaration
IUpdateJoin<T1, T2> SetIf(bool condition, Expression<Func<T1, T2, bool>> exp)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | condition | true 时生效 |
System.Linq.Expressions.Expression<System.Func<T1, T2, System.Boolean>> | exp |
Returns
Type | Description |
---|---|
IUpdateJoin<T1, T2> |
SetIf<TMember>(Boolean, Expression<Func<T1, TMember>>, TMember)
设置列的固定新值,Set(a => a.Name, "newvalue")
Declaration
IUpdateJoin<T1, T2> SetIf<TMember>(bool condition, Expression<Func<T1, TMember>> column, TMember value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | condition | true 时生效 |
System.Linq.Expressions.Expression<System.Func<T1, TMember>> | column | lambda选择列 |
TMember | value | 新值 |
Returns
Type | Description |
---|---|
IUpdateJoin<T1, T2> |
Type Parameters
Name | Description |
---|---|
TMember |
SetRaw(String, Object)
设置值,自定义SQL语法,SetRaw("title = @title", new { title = "newtitle" })
提示:parms 参数还可以传 Dictionary<string, object>
Declaration
IUpdateJoin<T1, T2> SetRaw(string sql, object parms = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | sql语法 |
System.Object | parms | 参数 |
Returns
Type | Description |
---|---|
IUpdateJoin<T1, T2> |
ToSql()
返回即将执行的SQL语句
Declaration
string ToSql()
Returns
Type | Description |
---|---|
System.String |
Where(Expression<Func<T1, T2, Boolean>>)
lambda表达式条件,仅支持实体基础成员(不包含导航对象)
Declaration
IUpdateJoin<T1, T2> Where(Expression<Func<T1, T2, bool>> exp)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<T1, T2, System.Boolean>> | exp | lambda表达式条件 |
Returns
Type | Description |
---|---|
IUpdateJoin<T1, T2> |
Where(String, Object)
原生sql语法条件,Where("id = @id", new { id = 1 })
提示:parms 参数还可以传 Dictionary<string, object>
Declaration
IUpdateJoin<T1, T2> Where(string sql, object parms = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | sql语法条件 |
System.Object | parms | 参数 |
Returns
Type | Description |
---|---|
IUpdateJoin<T1, T2> |
WhereIf(Boolean, Expression<Func<T1, T2, Boolean>>)
lambda表达式条件,仅支持实体基础成员(不包含导航对象)
Declaration
IUpdateJoin<T1, T2> WhereIf(bool condition, Expression<Func<T1, T2, bool>> exp)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | condition | true 时生效 |
System.Linq.Expressions.Expression<System.Func<T1, T2, System.Boolean>> | exp | lambda表达式条件 |
Returns
Type | Description |
---|---|
IUpdateJoin<T1, T2> |
WithConnection(DbConnection)
指定事务对象
Declaration
IUpdateJoin<T1, T2> WithConnection(DbConnection connection)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbConnection | connection |
Returns
Type | Description |
---|---|
IUpdateJoin<T1, T2> |
WithTransaction(DbTransaction)
指定事务对象
Declaration
IUpdateJoin<T1, T2> WithTransaction(DbTransaction transaction)
Parameters
Type | Name | Description |
---|---|---|
System.Data.Common.DbTransaction | transaction |
Returns
Type | Description |
---|---|
IUpdateJoin<T1, T2> |