共用方式為


作法:將資料行表示為資料庫產生的資料行

ColumnAttribute 屬性 (Attribute) 上,使用 LINQ to SQL IsDbGenerated 屬性 (Property),指定欄位或屬性 (Property) 來表示資料庫產生的資料行。

如需程式碼範例,請參閱 IsDbGenerated

若要指定欄位或屬性以表示資料庫產生的資料行

  1. IsDbGenerated 屬性 (Property) 加入至 ColumnAttribute 屬性 (Attribute)。

  2. 將屬性 (Property) 值設定為 true

另請參閱