Table of Contents

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

Func<DbCommand, DbCommandInterceptionContext, int?, int>

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

Action<DbCommand>

The DbCommand before being executed.

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

name string
isMySql bool
isOracle bool
isPostgreSQL bool
isHana bool

Returns

string

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 ComplexPropertyMapping
name string
prefix string

Returns

ScalarPropertyMapping

FindScalarPropertyMappingByName(MappingFragment, string)

public ScalarPropertyMapping FindScalarPropertyMappingByName(MappingFragment mapping, string name)

Parameters

mapping MappingFragment
name string

Returns

ScalarPropertyMapping

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 Type
memberInitExpression MemberInitExpression
listComplexeType 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

Dictionary<string, object>

Type Parameters

T