如何:將資料行表示為資料庫生成

在屬性IsDbGenerated上使用 LINQ to SQL ColumnAttribute 屬性,指定欄位或屬性代表資料庫產生的欄位。

關於程式碼範例,請參見 IsDbGenerated。

指定欄位或屬性代表資料庫產生的欄位

  1. 將 IsDbGenerated 屬性添加到 ColumnAttribute 屬性中。

  2. 將屬性值設為 true。

另請參閱