PrimitivePropertyConfiguration.HasDatabaseGeneratedOption 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
HasDatabaseGeneratedOption(Nullable<DatabaseGeneratedOption>) |
設定資料庫如何產生此屬性的值。 |
HasDatabaseGeneratedOption(Nullable<DatabaseGeneratedOption>) |
設定資料庫如何產生此屬性的值。 |
HasDatabaseGeneratedOption(Nullable<DatabaseGeneratedOption>)
設定資料庫如何產生此屬性的值。
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
參數
- databaseGeneratedOption
- Nullable<DatabaseGeneratedOption>
用來針對資料庫中的屬性產生值的模式。 設定 'null' 將會從 屬性中移除資料庫產生的模式 Facet。 設定 'null' 將會產生與指定 'None' 相同的執行階段行為。
傳回
相同的 PrimitivePropertyConfiguration 實例,以便鏈結多個呼叫。
適用於
HasDatabaseGeneratedOption(Nullable<DatabaseGeneratedOption>)
設定資料庫如何產生此屬性的值。
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
參數
- databaseGeneratedOption
- Nullable<DatabaseGeneratedOption>
用來針對資料庫中的屬性產生值的模式。 設定 'null' 會導致使用預設選項,這可能是 'None'、'Identity' 或 'Computed',視屬性的類型而定、模型中的語意 (例如,主鍵會以不同的方式處理) ,以及正在使用哪一組慣例。
傳回
相同的 PrimitivePropertyConfiguration 實例,以便鏈結多個呼叫。