Table of Contents

Class DbUpdateConcurrencyException

Namespace
Microsoft.EntityFrameworkCore
Assembly
Microsoft.EntityFrameworkCore.dll

An exception that is thrown when a concurrency violation is encountered while saving to the database. A concurrency violation occurs when an unexpected number of rows are affected during save. This is usually because the data in the database has been modified since it was loaded into memory.

public class DbUpdateConcurrencyException : DbUpdateException, ISerializable
Inheritance
DbUpdateConcurrencyException
Implements
Inherited Members

Remarks

See Handling concurrency conflicts for more information and examples.

Constructors

DbUpdateConcurrencyException()

Initializes a new instance of the DbUpdateConcurrencyException class.

public DbUpdateConcurrencyException()

DbUpdateConcurrencyException(SerializationInfo, StreamingContext)

Initializes a new instance of the DbUpdateException class from a serialized form.

[Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.")]
public DbUpdateConcurrencyException(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

The serialization info.

context StreamingContext

The streaming context being used.

DbUpdateConcurrencyException(string)

Initializes a new instance of the DbUpdateConcurrencyException class.

public DbUpdateConcurrencyException(string message)

Parameters

message string

The error message that explains the reason for the exception.

DbUpdateConcurrencyException(string, IReadOnlyList<IUpdateEntry>)

Initializes a new instance of the DbUpdateConcurrencyException class.

public DbUpdateConcurrencyException(string message, IReadOnlyList<IUpdateEntry> entries)

Parameters

message string

The error message that explains the reason for the exception.

entries IReadOnlyList<IUpdateEntry>

The entries that were involved in the concurrency violation.

DbUpdateConcurrencyException(string, Exception?)

Initializes a new instance of the DbUpdateConcurrencyException class.

public DbUpdateConcurrencyException(string message, Exception? innerException)

Parameters

message string

The error message that explains the reason for the exception.

innerException Exception

The exception that is the cause of the current exception.

DbUpdateConcurrencyException(string, Exception?, IReadOnlyList<IUpdateEntry>)

Initializes a new instance of the DbUpdateConcurrencyException class.

public DbUpdateConcurrencyException(string message, Exception? innerException, IReadOnlyList<IUpdateEntry> entries)

Parameters

message string

The error message that explains the reason for the exception.

innerException Exception

The exception that is the cause of the current exception.

entries IReadOnlyList<IUpdateEntry>

The entries that were involved in the error.