ConventionPropertyExtensions.SetValueGeneratorFactory 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將處理站設定為用於產生此屬性的值,或 null
清除任何先前設定的 Factory。
設定 null
不會停用這個屬性的值產生,它只會清除針對此屬性明確設定的任何產生器。 資料庫提供者可能仍有屬性類型的值產生器。
public static void SetValueGeneratorFactory (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, Func<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.IEntityType,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> valueGeneratorFactory, bool fromDataAnnotation = false);
public static Func<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.IEntityType,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> SetValueGeneratorFactory (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, Func<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.IEntityType,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> valueGeneratorFactory, bool fromDataAnnotation = false);
static member SetValueGeneratorFactory : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * Func<Microsoft.EntityFrameworkCore.Metadata.IProperty, Microsoft.EntityFrameworkCore.Metadata.IEntityType, Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> * bool -> unit
static member SetValueGeneratorFactory : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * Func<Microsoft.EntityFrameworkCore.Metadata.IProperty, Microsoft.EntityFrameworkCore.Metadata.IEntityType, Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> * bool -> Func<Microsoft.EntityFrameworkCore.Metadata.IProperty, Microsoft.EntityFrameworkCore.Metadata.IEntityType, Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator>
<Extension()>
Public Sub SetValueGeneratorFactory (property As IConventionProperty, valueGeneratorFactory As Func(Of IProperty, IEntityType, ValueGenerator), Optional fromDataAnnotation As Boolean = false)
<Extension()>
Public Function SetValueGeneratorFactory (property As IConventionProperty, valueGeneratorFactory As Func(Of IProperty, IEntityType, ValueGenerator), Optional fromDataAnnotation As Boolean = false) As Func(Of IProperty, IEntityType, ValueGenerator)
參數
- property
- IConventionProperty
要為其設定值產生器的 屬性。
- valueGeneratorFactory
- Func<IProperty,IEntityType,ValueGenerator>
將用來建立值產生器的處理站,或 null
清除任何先前設定的處理站。
- fromDataAnnotation
- Boolean
指出是否使用資料批註來指定組態。
傳回
已設定的值。