Share via


IConventionProperty.SetValueGeneratorFactory Method

Definition

Overloads

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

Sets the factory to use for generating values for this property, or null to clear any previously set factory.

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

Sets the factory to use for generating values for this property, or null to clear any previously set factory.

SetValueGeneratorFactory(Type, Boolean)

Sets the factory to use for generating values for this property, or null to clear any previously set factory.

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

Source:
IConventionProperty.cs
Source:
IConventionProperty.cs

Sets the factory to use for generating values for this property, or null to clear any previously set factory.

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

Parameters

valueGeneratorFactory
Func<IProperty,ITypeBase,ValueGenerator>

A factory that will be used to create the value generator, or null to clear any previously set factory.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The configured value.

Remarks

Setting null does not disable value generation for this property, it just clears any generator explicitly configured for this property. The database provider may still have a value generator for the property type.

Applies to

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

Source:
IConventionProperty.cs
Source:
IConventionProperty.cs

Sets the factory to use for generating values for this property, or null to clear any previously set factory.

public Func<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.IEntityType,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator>? SetValueGeneratorFactory (Func<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.IEntityType,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator>? valueGeneratorFactory, bool fromDataAnnotation = false);
abstract member SetValueGeneratorFactory : 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>
Public Function SetValueGeneratorFactory (valueGeneratorFactory As Func(Of IProperty, IEntityType, ValueGenerator), Optional fromDataAnnotation As Boolean = false) As Func(Of IProperty, IEntityType, ValueGenerator)

Parameters

valueGeneratorFactory
Func<IProperty,IEntityType,ValueGenerator>

A factory that will be used to create the value generator, or null to clear any previously set factory.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The configured value.

Remarks

Setting null does not disable value generation for this property, it just clears any generator explicitly configured for this property. The database provider may still have a value generator for the property type.

Applies to

SetValueGeneratorFactory(Type, Boolean)

Source:
IConventionProperty.cs
Source:
IConventionProperty.cs
Source:
IConventionProperty.cs
Source:
IConventionProperty.cs

Sets the factory to use for generating values for this property, or null to clear any previously set factory.

public Type? SetValueGeneratorFactory (Type? valueGeneratorFactory, bool fromDataAnnotation = false);
abstract member SetValueGeneratorFactory : Type * bool -> Type
Public Function SetValueGeneratorFactory (valueGeneratorFactory As Type, Optional fromDataAnnotation As Boolean = false) As Type

Parameters

valueGeneratorFactory
Type

A factory that will be used to create the value generator, or null to clear any previously set factory.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The configured value.

Remarks

Setting null does not disable value generation for this property, it just clears any generator explicitly configured for this property. The database provider may still have a value generator for the property type.

Applies to