Table of Contents

Class ModificationCommand

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

Represents a conceptual command to the database to insert/update/delete a row.

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

public class ModificationCommand
Inheritance
ModificationCommand
Inherited Members

Constructors

ModificationCommand(string, string, IReadOnlyList<ColumnModification>, bool)

Initializes a new ModificationCommand instance.

public ModificationCommand(string name, string schema, IReadOnlyList<ColumnModification> columnModifications, bool sensitiveLoggingEnabled)

Parameters

name string

The name of the table containing the data to be modified.

schema string

The schema containing the table, or null to use the default schema.

columnModifications IReadOnlyList<ColumnModification>

The list of ColumnModifications needed to perform the insert, update, or delete.

sensitiveLoggingEnabled bool

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

ModificationCommand(string, string, Func<string>, bool, IComparer<IUpdateEntry>)

Initializes a new ModificationCommand instance.

public ModificationCommand(string name, string schema, Func<string> generateParameterName, bool sensitiveLoggingEnabled, IComparer<IUpdateEntry> comparer)

Parameters

name string

The name of the table containing the data to be modified.

schema string

The schema containing the table, or null to use the default schema.

generateParameterName Func<string>

A delegate to generate parameter names.

sensitiveLoggingEnabled bool

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

comparer IComparer<IUpdateEntry>

A IComparer<T> for Microsoft.EntityFrameworkCore.Update.IUpdateEntrys.

Properties

ColumnModifications

The list of ColumnModifications needed to perform the insert, update, or delete.

public virtual IReadOnlyList<ColumnModification> ColumnModifications { get; }

Property Value

IReadOnlyList<ColumnModification>

EntityState

The Microsoft.EntityFrameworkCore.EntityState that indicates whether the row will be inserted (Microsoft.EntityFrameworkCore.EntityState.Added), updated (Microsoft.EntityFrameworkCore.EntityState.Modified), or deleted ((Microsoft.EntityFrameworkCore.EntityState.Deleted).

public virtual EntityState EntityState { get; }

Property Value

EntityState

Entries

The Microsoft.EntityFrameworkCore.Update.IUpdateEntrys that represent the entities that are mapped to the row to update.

public virtual IReadOnlyList<IUpdateEntry> Entries { get; }

Property Value

IReadOnlyList<IUpdateEntry>

RequiresResultPropagation

Indicates whether or not the database will return values for some mapped properties that will then need to be propagated back to the tracked entities.

public virtual bool RequiresResultPropagation { get; }

Property Value

bool

Schema

The schema containing the table, or null to use the default schema.

public virtual string Schema { get; }

Property Value

string

TableName

The name of the table containing the data to be modified.

public virtual string TableName { get; }

Property Value

string

Methods

AddEntry(IUpdateEntry, bool)

Adds an Microsoft.EntityFrameworkCore.Update.IUpdateEntry to this command representing an entity to be inserted, updated, or deleted.

public virtual void AddEntry(IUpdateEntry entry, bool mainEntry)

Parameters

entry IUpdateEntry

The entry representing the entity to add.

mainEntry bool

A value indicating whether this is the main entry for the row.

AssertColumnsNotInitialized()

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

[Conditional("DEBUG")]
public virtual void AssertColumnsNotInitialized()

PropagateResults(ValueBuffer)

Reads values returned from the database in the given Microsoft.EntityFrameworkCore.Storage.ValueBuffer and propagates them back to into the appropriate ColumnModification from which the values can be propagated on to tracked entities.

public virtual void PropagateResults(ValueBuffer valueBuffer)

Parameters

valueBuffer ValueBuffer

The buffer containing the values read from the database.

ToString()

public override string ToString()

Returns

string