Share via


DbUpdateConcurrencyException 類別

定義

預期實體的 SaveChanges 會導致資料庫更新,但實際上不會影響資料庫中的資料列時所擲回 DbContext 的例外狀況。 這通常表示資料庫已同時更新,因此預期相符的並行權杖實際上不相符。 請注意,此例外狀況所參考的狀態專案不會序列化,因為序列化之後的狀態專案安全性和存取權會傳回 null。

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Justification="SerializeObjectState used instead")]
[System.Serializable]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", Justification="FxCop rule is wrong; Database is not two words.", MessageId="Db")]
public class DbUpdateConcurrencyException : System.Data.Entity.Infrastructure.DbUpdateException
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Justification="SerializeObjectState used instead")]
[System.Serializable]
public class DbUpdateConcurrencyException : System.Data.Entity.Infrastructure.DbUpdateException
type DbUpdateConcurrencyException = class
    inherit DbUpdateException
Public Class DbUpdateConcurrencyException
Inherits DbUpdateException
繼承
DbUpdateConcurrencyException
屬性

建構函式

DbUpdateConcurrencyException()

初始化 DbUpdateException 類別的新執行個體。

DbUpdateConcurrencyException(String)

初始化 DbUpdateException 類別的新執行個體。

DbUpdateConcurrencyException(String, Exception)

初始化 DbUpdateException 類別的新執行個體。

屬性

Entries

取得 DbEntityEntry 物件,表示無法儲存至資料庫的實體。

(繼承來源 DbUpdateException)

適用於