語言

ConventionModelExtensions.AddOwned(IConventionModel, Type, Boolean) 方法

定義

標記該實體類型為擁有,表示發現該類型實體類型時應設定為擁有。

public static void AddOwned(this Microsoft.EntityFrameworkCore.Metadata.IConventionModel model, Type clrType, bool fromDataAnnotation = false);
public static void AddOwned(this Microsoft.EntityFrameworkCore.Metadata.IConventionModel model, Type type, bool fromDataAnnotation = false);
static member AddOwned : Microsoft.EntityFrameworkCore.Metadata.IConventionModel * Type * bool -> unit
static member AddOwned : Microsoft.EntityFrameworkCore.Metadata.IConventionModel * Type * bool -> unit
<Extension()>
Public Sub AddOwned (model As IConventionModel, clrType As Type, Optional fromDataAnnotation As Boolean = false)
<Extension()>
Public Sub AddOwned (model As IConventionModel, type As Type, Optional fromDataAnnotation As Boolean = false)

參數

model
IConventionModel

要加入擁有型態的模型。

clrTypetype
Type

應該擁有的實體類型。

fromDataAnnotation
Boolean

表示配置是否以資料註解方式指定。

適用於