ConventionModelExtensions.AddOwned(IConventionModel, Type, Boolean) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将给定实体类型标记为拥有,指示何时应将使用给定类型的发现实体类型配置为拥有。
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
指示是否使用数据注释指定了配置。