共用方式為


IConventionRelationshipBuilder.IsOwnership 方法

定義

設定此關聯性是否定義 (擁有權,亦即,是否一律必須透過主體實體導覽來存取相依實體) 。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionRelationshipBuilder IsOwnership (bool? ownership, bool fromDataAnnotation = false);
abstract member IsOwnership : Nullable<bool> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionRelationshipBuilder
Public Function IsOwnership (ownership As Nullable(Of Boolean), Optional fromDataAnnotation As Boolean = false) As IConventionRelationshipBuilder

參數

ownership
Nullable<Boolean>

值,指出這個關聯性是否定義擁有權。 null 將 重設為預設值。

fromDataAnnotation
Boolean

指出是否已使用資料批註指定組態。

傳回

如果已設定擁有權,則為相同的產生器實例, null 否則為 。

適用於