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
IUpdateEntryThe Microsoft.EntityFrameworkCore.Update.IUpdateEntry that represents the entity that is being modified.
property
IPropertyThe property that maps to the column.
column
IColumnThe column to be modified.
generateParameterName
Func<string>A delegate for generating parameter names for the update SQL.
typeMapping
RelationalTypeMappingThe relational type mapping to be used for the command parameter.
isRead
boolIndicates whether or not a value must be read from the database for the column.
isWrite
boolIndicates whether or not a value must be written to the database for the column.
isKey
boolIndicates whether or not the column part of a primary or alternate key.
isCondition
boolIndicates whether or not the column is used in the
WHERE
clause when updating.sensitiveLoggingEnabled
boolIndicates 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
IUpdateEntryThe Microsoft.EntityFrameworkCore.Update.IUpdateEntry that represents the entity that is being modified.
property
IPropertyThe property that maps to the column.
generateParameterName
Func<string>A delegate for generating parameter names for the update SQL.
isRead
boolIndicates whether or not a value must be read from the database for the column.
isWrite
boolIndicates whether or not a value must be written to the database for the column.
isKey
boolIndicates whether or not the column part of a primary or alternate key.
isCondition
boolIndicates whether or not the column is used in the
WHERE
clause when updating.isConcurrencyToken
boolIndicates whether or not the column is acting as an optimistic concurrency token.
sensitiveLoggingEnabled
boolIndicates 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
stringThe name of the column.
originalValue
objectThe original value of the property mapped to this column.
value
objectGets or sets the current value of the property mapped to this column.
property
IPropertyThe property that maps to the column.
isRead
boolIndicates whether or not a value must be read from the database for the column.
isWrite
boolIndicates whether or not a value must be written to the database for the column.
isKey
boolIndicates whether or not the column part of a primary or alternate key.
isCondition
boolIndicates whether or not the column is used in the
WHERE
clause when updating.sensitiveLoggingEnabled
boolIndicates 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
stringThe name of the column.
originalValue
objectThe original value of the property mapped to this column.
value
objectGets or sets the current value of the property mapped to this column.
property
IPropertyThe property that maps to the column.
columnType
stringThe database type of the column.
typeMapping
RelationalTypeMappingThe relational type mapping to be used for the command parameter.
isRead
boolIndicates whether or not a value must be read from the database for the column.
isWrite
boolIndicates whether or not a value must be written to the database for the column.
isKey
boolIndicates whether or not the column part of a primary or alternate key.
isCondition
boolIndicates whether or not the column is used in the
WHERE
clause when updating.sensitiveLoggingEnabled
boolIndicates 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
stringThe name of the column.
originalValue
objectThe original value of the property mapped to this column.
value
objectGets or sets the current value of the property mapped to this column.
property
IPropertyThe property that maps to the column.
columnType
stringThe database type of the column.
isRead
boolIndicates whether or not a value must be read from the database for the column.
isWrite
boolIndicates whether or not a value must be written to the database for the column.
isKey
boolIndicates whether or not the column part of a primary or alternate key.
isCondition
boolIndicates whether or not the column is used in the
WHERE
clause when updating.sensitiveLoggingEnabled
boolIndicates 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
modification
ColumnModificationThe modification for the shared column.