DbContextId 結構

定義

如果有的話,內容實例和集區租用的唯一識別碼。

[System.Runtime.CompilerServices.IsReadOnly]
public readonly struct DbContextId
public readonly struct DbContextId
[<System.Runtime.CompilerServices.IsReadOnly>]
type DbContextId = struct
type DbContextId = struct
Public Structure DbContextId
繼承
DbContextId
屬性

備註

此識別碼主要是做為記錄和偵錯的相互關聯識別碼,以便輕鬆地識別多個事件正在使用相同或不同的內容實例。

如需詳細資訊 和範例,請參閱 DbCoNtext 存留期、設定和初始化

建構函式

DbContextId(Guid, Int32)

使用指定的 InstanceId 和 租用號碼建立新的 DbContextId

屬性

InstanceId

所使用 的唯一識別碼 DbContext

Lease

每次從內容集區租用這個特定 DbContext 實例時遞增的數位。

方法

Equals(DbContextId)

將此識別碼與另一個識別碼進行比較,以查看它們是否代表相同的租用內容。

Equals(Object)

將此識別碼與另一個識別碼進行比較,以查看它們是否代表相同的租用內容。

GetHashCode()

此識別碼的雜湊碼。

ToString()

傳回實例識別碼和租用編號。

運算子

Equality(DbContextId, DbContextId)

比較一個識別碼與另一個識別碼,以查看它們是否代表相同的租用內容。

Inequality(DbContextId, DbContextId)

比較一個識別碼與另一個識別碼,以查看它們是否代表不同的租用內容。

適用於