Share via


IConventionPropertyBuilder.HasValueGenerator Method

Definition

Overloads

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

Configures the ValueGenerator that will generate values for this property.

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

Configures the ValueGenerator that will generate values for this property.

HasValueGenerator(Type, Boolean)

Configures the ValueGenerator that will generate values for this property.

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

Configures the ValueGenerator that will generate values for this property.

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

Parameters

factory
Func<IProperty,IEntityType,ValueGenerator>

A delegate that will be used to create value generator instances.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The same builder instance if the configuration was applied, null otherwise.

Applies to

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

Configures the ValueGenerator that will generate values for this property.

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

Parameters

factory
Func<IProperty,ITypeBase,ValueGenerator>

A delegate that will be used to create value generator instances.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The same builder instance if the configuration was applied, null otherwise.

Applies to

HasValueGenerator(Type, Boolean)

Configures the ValueGenerator that will generate values for this property.

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

Parameters

valueGeneratorType
Type

A type that inherits from ValueGenerator.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The same builder instance if the configuration was applied, null otherwise.

Applies to