Dela via


MutablePropertyExtensions.SetValueGeneratorFactory Method

Definition

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

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.

public static void SetValueGeneratorFactory (this Microsoft.EntityFrameworkCore.Metadata.IMutableProperty property, Func<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.IEntityType,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> valueGeneratorFactory);
static member SetValueGeneratorFactory : Microsoft.EntityFrameworkCore.Metadata.IMutableProperty * Func<Microsoft.EntityFrameworkCore.Metadata.IProperty, Microsoft.EntityFrameworkCore.Metadata.IEntityType, Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> -> unit
<Extension()>
Public Sub SetValueGeneratorFactory (property As IMutableProperty, valueGeneratorFactory As Func(Of IProperty, IEntityType, ValueGenerator))

Parameters

property
IMutableProperty

The property to set the value generator for.

valueGeneratorFactory
Func<IProperty,IEntityType,ValueGenerator>

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

Applies to