语言

IConventionPropertyBuilder.HasValueGenerator 方法

定义

重载

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

Source:
IConventionPropertyBuilder.cs

配置 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)

Source:
IConventionPropertyBuilder.cs
Source:
IConventionPropertyBuilder.cs
Source:
IConventionPropertyBuilder.cs
Source:
IConventionPropertyBuilder.cs

配置 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)

Source:
IConventionPropertyBuilder.cs
Source:
IConventionPropertyBuilder.cs
Source:
IConventionPropertyBuilder.cs
Source:
IConventionPropertyBuilder.cs
Source:
IConventionPropertyBuilder.cs

配置 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 否则为同一个生成器实例。

适用于