Share via


PrimitivePropertyConfiguration.HasDatabaseGeneratedOption Method

Definition

Overloads

HasDatabaseGeneratedOption(Nullable<DatabaseGeneratedOption>)

Configures how values for the property are generated by the database.

HasDatabaseGeneratedOption(Nullable<DatabaseGeneratedOption>)

Configures how values for the property are generated by the database.

HasDatabaseGeneratedOption(Nullable<DatabaseGeneratedOption>)

Configures how values for the property are generated by the database.

public System.Data.Entity.ModelConfiguration.Configuration.PrimitivePropertyConfiguration HasDatabaseGeneratedOption (Nullable<System.ComponentModel.DataAnnotations.DatabaseGeneratedOption> databaseGeneratedOption);
member this.HasDatabaseGeneratedOption : Nullable<System.ComponentModel.DataAnnotations.DatabaseGeneratedOption> -> System.Data.Entity.ModelConfiguration.Configuration.PrimitivePropertyConfiguration
Public Function HasDatabaseGeneratedOption (databaseGeneratedOption As Nullable(Of DatabaseGeneratedOption)) As PrimitivePropertyConfiguration

Parameters

databaseGeneratedOption
Nullable<DatabaseGeneratedOption>

The pattern used to generate values for the property in the database. Setting 'null' will remove the database generated pattern facet from the property. Setting 'null' will cause the same runtime behavior as specifying 'None'.

Returns

The same PrimitivePropertyConfiguration instance so that multiple calls can be chained.

Applies to

HasDatabaseGeneratedOption(Nullable<DatabaseGeneratedOption>)

Configures how values for the property are generated by the database.

public System.Data.Entity.ModelConfiguration.Configuration.PrimitivePropertyConfiguration HasDatabaseGeneratedOption (Nullable<System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption> databaseGeneratedOption);
member this.HasDatabaseGeneratedOption : Nullable<System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption> -> System.Data.Entity.ModelConfiguration.Configuration.PrimitivePropertyConfiguration
Public Function HasDatabaseGeneratedOption (databaseGeneratedOption As Nullable(Of DatabaseGeneratedOption)) As PrimitivePropertyConfiguration

Parameters

databaseGeneratedOption
Nullable<DatabaseGeneratedOption>

The pattern used to generate values for the property in the database. Setting 'null' will cause the default option to be used, which may be 'None', 'Identity', or 'Computed' depending on the type of the property, its semantics in the model (e.g. primary keys are treated differently), and which set of conventions are being used.

Returns

The same PrimitivePropertyConfiguration instance so that multiple calls can be chained.

Applies to