Class InsertOrUpdateProvider<T1>
Inheritance
System.Object
InsertOrUpdateProvider<T1>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: FreeSql.dll
Syntax
public abstract class InsertOrUpdateProvider<T1> : InsertOrUpdateProvider, IInsertOrUpdate<T1> where T1 : class
Type Parameters
Constructors
|
Improve this Doc
View Source
InsertOrUpdateProvider(IFreeSql, CommonUtils, CommonExpression)
Declaration
public InsertOrUpdateProvider(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression)
Parameters
Fields
|
Improve this Doc
View Source
_source
Declaration
Field Value
| Type |
Description |
| System.Collections.Generic.List<T1> |
|
|
Improve this Doc
View Source
_sourceSql
Declaration
Field Value
| Type |
Description |
| System.String |
|
Methods
|
Improve this Doc
View Source
AsTable(Func<String, String>)
Declaration
public IInsertOrUpdate<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
public IInsertOrUpdate<T1> AsTable(string tableName)
Parameters
| Type |
Name |
Description |
| System.String |
tableName |
|
Returns
|
Improve this Doc
View Source
AsType(Type)
Declaration
public IInsertOrUpdate<T1> AsType(Type entityType)
Parameters
| Type |
Name |
Description |
| System.Type |
entityType |
|
Returns
|
Improve this Doc
View Source
AuditDataValue(Object, T1, IFreeSql, TableInfo, Dictionary<String, Boolean>)
Declaration
public static void AuditDataValue(object sender, T1 data, IFreeSql orm, TableInfo table, Dictionary<string, bool> changedDict)
Parameters
| Type |
Name |
Description |
| System.Object |
sender |
|
| T1 |
data |
|
| IFreeSql |
orm |
|
| TableInfo |
table |
|
| System.Collections.Generic.Dictionary<System.String, System.Boolean> |
changedDict |
|
|
Improve this Doc
View Source
AuditDataValue(Object, IEnumerable<T1>, IFreeSql, TableInfo, Dictionary<String, Boolean>)
Declaration
public static void AuditDataValue(object sender, IEnumerable<T1> data, IFreeSql orm, TableInfo table, Dictionary<string, bool> changedDict)
Parameters
| Type |
Name |
Description |
| System.Object |
sender |
|
| System.Collections.Generic.IEnumerable<T1> |
data |
|
| IFreeSql |
orm |
|
| TableInfo |
table |
|
| System.Collections.Generic.Dictionary<System.String, System.Boolean> |
changedDict |
|
|
Improve this Doc
View Source
ClearData()
Declaration
protected void ClearData()
|
Improve this Doc
View Source
CommandTimeout(Int32)
Declaration
public IInsertOrUpdate<T1> CommandTimeout(int timeout)
Parameters
| Type |
Name |
Description |
| System.Int32 |
timeout |
|
Returns
|
Improve this Doc
View Source
ExecuteAffrows()
Declaration
public int ExecuteAffrows()
Returns
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
ExecuteAffrowsAsync(CancellationToken)
Declaration
public async 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
IfExistsDoNothing()
Declaration
public IInsertOrUpdate<T1> IfExistsDoNothing()
Returns
|
Improve this Doc
View Source
RawExecuteAffrows()
Declaration
public int RawExecuteAffrows()
Returns
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
RawExecuteAffrowsAsync(CancellationToken)
Declaration
public async Task<int> RawExecuteAffrowsAsync(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
SetSource(T1)
Declaration
public IInsertOrUpdate<T1> SetSource(T1 source)
Parameters
| Type |
Name |
Description |
| T1 |
source |
|
Returns
|
Improve this Doc
View Source
SetSource(T1, Expression<Func<T1, Object>>)
Declaration
public IInsertOrUpdate<T1> SetSource(T1 source, Expression<Func<T1, object>> tempPrimarys)
Parameters
| Type |
Name |
Description |
| T1 |
source |
|
| System.Linq.Expressions.Expression<System.Func<T1, System.Object>> |
tempPrimarys |
|
Returns
|
Improve this Doc
View Source
SetSource(IEnumerable<T1>, Expression<Func<T1, Object>>)
Declaration
public IInsertOrUpdate<T1> SetSource(IEnumerable<T1> source, Expression<Func<T1, object>> tempPrimarys = null)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<T1> |
source |
|
| System.Linq.Expressions.Expression<System.Func<T1, System.Object>> |
tempPrimarys |
|
Returns
|
Improve this Doc
View Source
SetSource(String, Expression<Func<T1, Object>>)
Declaration
public virtual IInsertOrUpdate<T1> SetSource(string sql, Expression<Func<T1, object>> tempPrimarys = null)
Parameters
| Type |
Name |
Description |
| System.String |
sql |
|
| System.Linq.Expressions.Expression<System.Func<T1, System.Object>> |
tempPrimarys |
|
Returns
|
Improve this Doc
View Source
SplitSourceByIdentityValueIsNull(List<T1>)
如果实体类有自增属性,分成两个 List,有值的Item1 merge,无值的Item2 insert
Declaration
public NativeTuple<List<T1>[], List<T1>[]> SplitSourceByIdentityValueIsNull(List<T1> source)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<T1> |
source |
|
Returns
| Type |
Description |
| NativeTuple<System.Collections.Generic.List<T1>[], System.Collections.Generic.List<T1>[]> |
|
|
Improve this Doc
View Source
TableRuleInvoke()
Declaration
protected string TableRuleInvoke()
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
ToSql()
Declaration
public abstract string ToSql()
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
UpdateColumns(Expression<Func<T1, Object>>)
Declaration
public IInsertOrUpdate<T1> UpdateColumns(Expression<Func<T1, object>> columns)
Parameters
| Type |
Name |
Description |
| System.Linq.Expressions.Expression<System.Func<T1, System.Object>> |
columns |
|
Returns
|
Improve this Doc
View Source
UpdateColumns(String[])
Declaration
public IInsertOrUpdate<T1> UpdateColumns(string[] columns)
Parameters
| Type |
Name |
Description |
| System.String[] |
columns |
|
Returns
|
Improve this Doc
View Source
UpdateSet<TMember>(Expression<Func<T1, T1, TMember>>)
Declaration
public IInsertOrUpdate<T1> UpdateSet<TMember>(Expression<Func<T1, T1, TMember>> exp)
Parameters
| Type |
Name |
Description |
| System.Linq.Expressions.Expression<System.Func<T1, T1, TMember>> |
exp |
|
Returns
Type Parameters
|
Improve this Doc
View Source
WithConnection(DbConnection)
Declaration
public IInsertOrUpdate<T1> WithConnection(DbConnection connection)
Parameters
| Type |
Name |
Description |
| System.Data.Common.DbConnection |
connection |
|
Returns
|
Improve this Doc
View Source
WithTransaction(DbTransaction)
Declaration
public IInsertOrUpdate<T1> WithTransaction(DbTransaction transaction)
Parameters
| Type |
Name |
Description |
| System.Data.Common.DbTransaction |
transaction |
|
Returns
|
Improve this Doc
View Source
WriteSourceSelectUnionAll(List<T1>, StringBuilder, List<DbParameter>)
Declaration
public void WriteSourceSelectUnionAll(List<T1> source, StringBuilder sb, List<DbParameter> dbParams)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<T1> |
source |
|
| System.Text.StringBuilder |
sb |
|
| System.Collections.Generic.List<System.Data.Common.DbParameter> |
dbParams |
|
Implements