共用方式為


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)

來源:
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)

來源:
IConventionPropertyBuilder.cs
來源:
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)

來源:
IConventionPropertyBuilder.cs
來源:
IConventionPropertyBuilder.cs
來源:
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 否則為 。

適用於