共用方式為


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

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

適用於