IConventionPropertyBuilder.HasValueGenerator 方法

定义

重载

HasValueGenerator(Func<IProperty,IEntityType,ValueGenerator>, Boolean)

ValueGenerator配置将为此属性生成值的 。

HasValueGenerator(Func<IProperty,ITypeBase,ValueGenerator>, Boolean)

ValueGenerator配置将为此属性生成值的 。

HasValueGenerator(Type, Boolean)

ValueGenerator配置将为此属性生成值的 。

HasValueGenerator(Func<IProperty,IEntityType,ValueGenerator>, Boolean)

ValueGenerator配置将为此属性生成值的 。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder HasValueGenerator (Func<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.IEntityType,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> factory, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? HasValueGenerator (Func<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.IEntityType,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator>? factory, bool fromDataAnnotation = false);
abstract member HasValueGenerator : Func<Microsoft.EntityFrameworkCore.Metadata.IProperty, Microsoft.EntityFrameworkCore.Metadata.IEntityType, Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
Public Function HasValueGenerator (factory As Func(Of IProperty, IEntityType, ValueGenerator), Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder

参数

factory
Func<IProperty,IEntityType,ValueGenerator>

将用于创建值生成器实例的委托。

fromDataAnnotation
Boolean

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

返回

如果应用了配置,则为同一生成器实例, null 否则为 。

适用于

HasValueGenerator(Func<IProperty,ITypeBase,ValueGenerator>, Boolean)

ValueGenerator配置将为此属性生成值的 。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? HasValueGenerator (Func<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.ITypeBase,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator>? factory, bool fromDataAnnotation = false);
abstract member HasValueGenerator : Func<Microsoft.EntityFrameworkCore.Metadata.IProperty, Microsoft.EntityFrameworkCore.Metadata.ITypeBase, Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
Public Function HasValueGenerator (factory As Func(Of IProperty, ITypeBase, ValueGenerator), Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder

参数

factory
Func<IProperty,ITypeBase,ValueGenerator>

将用于创建值生成器实例的委托。

fromDataAnnotation
Boolean

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

返回

如果应用了配置,则为同一生成器实例, null 否则为 。

适用于

HasValueGenerator(Type, Boolean)

ValueGenerator配置将为此属性生成值的 。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder HasValueGenerator (Type valueGeneratorType, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? HasValueGenerator (Type? valueGeneratorType, bool fromDataAnnotation = false);
abstract member HasValueGenerator : Type * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
Public Function HasValueGenerator (valueGeneratorType As Type, Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder

参数

valueGeneratorType
Type

继承自 ValueGenerator的类型。

fromDataAnnotation
Boolean

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

返回

如果应用了配置,则为同一生成器实例, null 否则为 。

适用于