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
指出是否使用資料批註來指定組態。