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
entryIUpdateEntryThe Microsoft.EntityFrameworkCore.Update.IUpdateEntry that represents the entity that is being modified.
propertyIPropertyThe property that maps to the column.
columnIColumnThe column to be modified.
generateParameterNameFunc<string>A delegate for generating parameter names for the update SQL.
typeMappingRelationalTypeMappingThe relational type mapping to be used for the command parameter.
isReadboolIndicates whether or not a value must be read from the database for the column.
isWriteboolIndicates whether or not a value must be written to the database for the column.
isKeyboolIndicates whether or not the column part of a primary or alternate key.
isConditionboolIndicates whether or not the column is used in the
WHEREclause when updating.sensitiveLoggingEnabledboolIndicates 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
entryIUpdateEntryThe Microsoft.EntityFrameworkCore.Update.IUpdateEntry that represents the entity that is being modified.
propertyIPropertyThe property that maps to the column.
generateParameterNameFunc<string>A delegate for generating parameter names for the update SQL.
isReadboolIndicates whether or not a value must be read from the database for the column.
isWriteboolIndicates whether or not a value must be written to the database for the column.
isKeyboolIndicates whether or not the column part of a primary or alternate key.
isConditionboolIndicates whether or not the column is used in the
WHEREclause when updating.isConcurrencyTokenboolIndicates whether or not the column is acting as an optimistic concurrency token.
sensitiveLoggingEnabledboolIndicates 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
columnNamestringThe name of the column.
originalValueobjectThe original value of the property mapped to this column.
valueobjectGets or sets the current value of the property mapped to this column.
propertyIPropertyThe property that maps to the column.
isReadboolIndicates whether or not a value must be read from the database for the column.
isWriteboolIndicates whether or not a value must be written to the database for the column.
isKeyboolIndicates whether or not the column part of a primary or alternate key.
isConditionboolIndicates whether or not the column is used in the
WHEREclause when updating.sensitiveLoggingEnabledboolIndicates 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
columnNamestringThe name of the column.
originalValueobjectThe original value of the property mapped to this column.
valueobjectGets or sets the current value of the property mapped to this column.
propertyIPropertyThe property that maps to the column.
columnTypestringThe database type of the column.
typeMappingRelationalTypeMappingThe relational type mapping to be used for the command parameter.
isReadboolIndicates whether or not a value must be read from the database for the column.
isWriteboolIndicates whether or not a value must be written to the database for the column.
isKeyboolIndicates whether or not the column part of a primary or alternate key.
isConditionboolIndicates whether or not the column is used in the
WHEREclause when updating.sensitiveLoggingEnabledboolIndicates whether or not potentially sensitive data (e.g. database values) can be logged.
isNullablebool?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
columnNamestringThe name of the column.
originalValueobjectThe original value of the property mapped to this column.
valueobjectGets or sets the current value of the property mapped to this column.
propertyIPropertyThe property that maps to the column.
columnTypestringThe database type of the column.
isReadboolIndicates whether or not a value must be read from the database for the column.
isWriteboolIndicates whether or not a value must be written to the database for the column.
isKeyboolIndicates whether or not the column part of a primary or alternate key.
isConditionboolIndicates whether or not the column is used in the
WHEREclause when updating.sensitiveLoggingEnabledboolIndicates 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
ColumnType
The database type of the column.
public virtual string ColumnType { get; }
Property Value
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
IsCondition
Indicates whether or not the column is used in the WHERE clause when updating.
public virtual bool IsCondition { get; }
Property Value
IsKey
Indicates whether or not the column is part of a primary or alternate key.
public virtual bool IsKey { get; }
Property Value
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
IsWrite
Indicates whether or not a value must be written to the database for the column.
public virtual bool IsWrite { get; }
Property Value
OriginalParameterName
The parameter name to use for the original value parameter (UseOriginalValueParameter), if needed.
public virtual string OriginalParameterName { get; }
Property Value
OriginalValue
The original value of the property mapped to this column.
public virtual object OriginalValue { get; }
Property Value
ParameterName
The parameter name to use for the current value parameter (UseCurrentValueParameter), if needed.
public virtual string ParameterName { get; }
Property Value
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
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
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
Value
Gets or sets the current value of the property mapped to this column.
public virtual object Value { get; set; }
Property Value
Methods
AddSharedColumnModification(ColumnModification)
Adds a modification affecting the same database value.
public virtual void AddSharedColumnModification(ColumnModification modification)
Parameters
modificationColumnModificationThe modification for the shared column.