Class BatchUpdate
- Namespace
- Z.EntityFramework.Extensions
- Assembly
- Z.EntityFramework.Extensions.dll
Class to batch update.
public class BatchUpdate
- Inheritance
-
BatchUpdate
- Inherited Members
Constructors
BatchUpdate()
public BatchUpdate()
Fields
CommandExecuteAction
Set the CommandExecutionAction function
public Func<DbCommand, DbCommandInterceptionContext, int?, int> CommandExecuteAction
Field Value
Properties
BatchSize
Gets or sets the size of the batch.
public int? BatchSize { get; set; }
Property Value
- int?
The size of the batch.
Executing
Gets or sets the DbCommand before being executed.
public Action<DbCommand> Executing { get; set; }
Property Value
UseTableLock
Gets or sets a value indicating whether the query use table lock.
public bool UseTableLock { get; set; }
Property Value
- bool
True if use table lock, false if not.
Methods
EscapeName(string, bool, bool, bool, bool)
public string EscapeName(string name, bool isMySql, bool isOracle, bool isPostgreSQL, bool isHana)
Parameters
Returns
Execute<T>(IQueryable<T>, Expression<Func<T, T>>)
Executes the batch update operation.
public int Execute<T>(IQueryable<T> query, Expression<Func<T, T>> updateFactory) where T : class
Parameters
query
IQueryable<T>The query used to execute the batch operation.
updateFactory
Expression<Func<T, T>>The update factory.
Returns
- int
The number of rows affected.
Type Parameters
T
The type of elements of the query.
FindScalarPropertyMappingByName(ComplexPropertyMapping, string, string)
public ScalarPropertyMapping FindScalarPropertyMappingByName(ComplexPropertyMapping mapping, string name, string prefix)
Parameters
mapping
ComplexPropertyMappingname
stringprefix
string
Returns
FindScalarPropertyMappingByName(MappingFragment, string)
public ScalarPropertyMapping FindScalarPropertyMappingByName(MappingFragment mapping, string name)
Parameters
mapping
MappingFragmentname
string
Returns
ResolveUpdateFromQueryDictValuesMemberInit(Dictionary<string, object>, Type, MemberInitExpression, List<Type>, string)
public void ResolveUpdateFromQueryDictValuesMemberInit(Dictionary<string, object> dictValues, Type entityType, MemberInitExpression memberInitExpression, List<Type> listComplexeType, string prefix = "")
Parameters
dictValues
Dictionary<string, object>entityType
TypememberInitExpression
MemberInitExpressionlistComplexeType
List<Type>prefix
string
ResolveUpdateFromQueryDictValues<T>(Expression<Func<T, T>>, List<Type>)
public Dictionary<string, object> ResolveUpdateFromQueryDictValues<T>(Expression<Func<T, T>> updateFactory, List<Type> listComplexeType)
Parameters
updateFactory
Expression<Func<T, T>>listComplexeType
List<Type>
Returns
Type Parameters
T