Table of Contents

Class ColumnModification

Namespace
Microsoft.EntityFrameworkCore.Update
Assembly
Microsoft.EntityFrameworkCore.Relational.dll

Represents an update, insert, or delete operation for a single column. ModificationCommands contain lists of ColumnModifications.

This type is typically used by database providers; it is generally not used in application code.

public class ColumnModification
Inheritance
ColumnModification
Inherited Members

Constructors

ColumnModification(IUpdateEntry, IProperty, IColumn, Func<string>, RelationalTypeMapping, bool, bool, bool, bool, bool)

Creates a new ColumnModification instance.

public ColumnModification(IUpdateEntry entry, IProperty property, IColumn column, Func<string> generateParameterName, RelationalTypeMapping typeMapping, bool isRead, bool isWrite, bool isKey, bool isCondition, bool sensitiveLoggingEnabled)

Parameters

entry IUpdateEntry

The Microsoft.EntityFrameworkCore.Update.IUpdateEntry that represents the entity that is being modified.

property IProperty

The property that maps to the column.

column IColumn

The column to be modified.

generateParameterName Func<string>

A delegate for generating parameter names for the update SQL.

typeMapping RelationalTypeMapping

The relational type mapping to be used for the command parameter.

isRead bool

Indicates whether or not a value must be read from the database for the column.

isWrite bool

Indicates whether or not a value must be written to the database for the column.

isKey bool

Indicates whether or not the column part of a primary or alternate key.

isCondition bool

Indicates whether or not the column is used in the WHERE clause when updating.

sensitiveLoggingEnabled bool

Indicates whether or not potentially sensitive data (e.g. database values) can be logged.

ColumnModification(IUpdateEntry, IProperty, Func<string>, bool, bool, bool, bool, bool, bool)

Creates a new ColumnModification instance.

[Obsolete("Use the constructor with column")]
public ColumnModification(IUpdateEntry entry, IProperty property, Func<string> generateParameterName, bool isRead, bool isWrite, bool isKey, bool isCondition, bool isConcurrencyToken, bool sensitiveLoggingEnabled)

Parameters

entry IUpdateEntry

The Microsoft.EntityFrameworkCore.Update.IUpdateEntry that represents the entity that is being modified.

property IProperty

The property that maps to the column.

generateParameterName Func<string>

A delegate for generating parameter names for the update SQL.

isRead bool

Indicates whether or not a value must be read from the database for the column.

isWrite bool

Indicates whether or not a value must be written to the database for the column.

isKey bool

Indicates whether or not the column part of a primary or alternate key.

isCondition bool

Indicates whether or not the column is used in the WHERE clause when updating.

isConcurrencyToken bool

Indicates whether or not the column is acting as an optimistic concurrency token.

sensitiveLoggingEnabled bool

Indicates whether or not potentially sensitive data (e.g. database values) can be logged.

ColumnModification(string, object, object, IProperty, bool, bool, bool, bool, bool)

Creates a new ColumnModification instance.

[Obsolete("Use the constructor with columnType")]
public ColumnModification(string columnName, object originalValue, object value, IProperty property, bool isRead, bool isWrite, bool isKey, bool isCondition, bool sensitiveLoggingEnabled)

Parameters

columnName string

The name of the column.

originalValue object

The original value of the property mapped to this column.

value object

Gets or sets the current value of the property mapped to this column.

property IProperty

The property that maps to the column.

isRead bool

Indicates whether or not a value must be read from the database for the column.

isWrite bool

Indicates whether or not a value must be written to the database for the column.

isKey bool

Indicates whether or not the column part of a primary or alternate key.

isCondition bool

Indicates whether or not the column is used in the WHERE clause when updating.

sensitiveLoggingEnabled bool

Indicates whether or not potentially sensitive data (e.g. database values) can be logged.

ColumnModification(string, object, object, IProperty, string, RelationalTypeMapping, bool, bool, bool, bool, bool, bool?)

Creates a new ColumnModification instance.

public ColumnModification(string columnName, object originalValue, object value, IProperty property, string columnType, RelationalTypeMapping typeMapping, bool isRead, bool isWrite, bool isKey, bool isCondition, bool sensitiveLoggingEnabled, bool? isNullable = null)

Parameters

columnName string

The name of the column.

originalValue object

The original value of the property mapped to this column.

value object

Gets or sets the current value of the property mapped to this column.

property IProperty

The property that maps to the column.

columnType string

The database type of the column.

typeMapping RelationalTypeMapping

The relational type mapping to be used for the command parameter.

isRead bool

Indicates whether or not a value must be read from the database for the column.

isWrite bool

Indicates whether or not a value must be written to the database for the column.

isKey bool

Indicates whether or not the column part of a primary or alternate key.

isCondition bool

Indicates whether or not the column is used in the WHERE clause when updating.

sensitiveLoggingEnabled bool

Indicates whether or not potentially sensitive data (e.g. database values) can be logged.

isNullable bool?

A value indicating whether the value could be null.

ColumnModification(string, object, object, IProperty, string, bool, bool, bool, bool, bool)

Creates a new ColumnModification instance.

[Obsolete("Use the constructor with type mapping")]
public ColumnModification(string columnName, object originalValue, object value, IProperty property, string columnType, bool isRead, bool isWrite, bool isKey, bool isCondition, bool sensitiveLoggingEnabled)

Parameters

columnName string

The name of the column.

originalValue object

The original value of the property mapped to this column.

value object

Gets or sets the current value of the property mapped to this column.

property IProperty

The property that maps to the column.

columnType string

The database type of the column.

isRead bool

Indicates whether or not a value must be read from the database for the column.

isWrite bool

Indicates whether or not a value must be written to the database for the column.

isKey bool

Indicates whether or not the column part of a primary or alternate key.

isCondition bool

Indicates whether or not the column is used in the WHERE clause when updating.

sensitiveLoggingEnabled bool

Indicates whether or not potentially sensitive data (e.g. database values) can be logged.

Properties

ColumnName

The name of the column.

public virtual string ColumnName { get; }

Property Value

string

ColumnType

The database type of the column.

public virtual string ColumnType { get; }

Property Value

string

Entry

The Microsoft.EntityFrameworkCore.Update.IUpdateEntry that represents the entity that is being modified.

public virtual IUpdateEntry Entry { get; }

Property Value

IUpdateEntry

IsConcurrencyToken

Indicates whether or not the column is concurrency token.

[Obsolete]
public virtual bool IsConcurrencyToken { get; }

Property Value

bool

IsCondition

Indicates whether or not the column is used in the WHERE clause when updating.

public virtual bool IsCondition { get; }

Property Value

bool

IsKey

Indicates whether or not the column is part of a primary or alternate key.

public virtual bool IsKey { get; }

Property Value

bool

IsNullable

A value indicating whether the column could contain a null value.

public virtual bool? IsNullable { get; }

Property Value

bool?

IsRead

Indicates whether or not a value must be read from the database for the column.

public virtual bool IsRead { get; }

Property Value

bool

IsWrite

Indicates whether or not a value must be written to the database for the column.

public virtual bool IsWrite { get; }

Property Value

bool

OriginalParameterName

The parameter name to use for the original value parameter (UseOriginalValueParameter), if needed.

public virtual string OriginalParameterName { get; }

Property Value

string

OriginalValue

The original value of the property mapped to this column.

public virtual object OriginalValue { get; }

Property Value

object

ParameterName

The parameter name to use for the current value parameter (UseCurrentValueParameter), if needed.

public virtual string ParameterName { get; }

Property Value

string

Property

The property that maps to the column.

public virtual IProperty Property { get; }

Property Value

IProperty

TypeMapping

The relational type mapping for the column.

public virtual RelationalTypeMapping TypeMapping { get; }

Property Value

RelationalTypeMapping

UseCurrentValueParameter

Indicates whether the current value of the property must be passed as a parameter to the SQL

public virtual bool UseCurrentValueParameter { get; }

Property Value

bool

UseOriginalValueParameter

Indicates whether the original value of the property must be passed as a parameter to the SQL

public virtual bool UseOriginalValueParameter { get; }

Property Value

bool

Value

Gets or sets the current value of the property mapped to this column.

public virtual object Value { get; set; }

Property Value

object

Methods

AddSharedColumnModification(ColumnModification)

Adds a modification affecting the same database value.

public virtual void AddSharedColumnModification(ColumnModification modification)

Parameters

modification ColumnModification

The modification for the shared column.