语言

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

指示是否使用数据注释指定了配置。

适用于