ConventionPropertyExtensions.SetValueGeneratorFactory 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
设置工厂以用于为此属性生成值,或 null
清除以前设置的任何工厂。
设置 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
指示配置是否是使用数据注释指定的。
返回
配置的值。