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

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

适用于