TableAttribute.Name 屬性

定義

取得或設定表格或視圖的名稱。

public:
 property System::String ^ Name { System::String ^ get(); void set(System::String ^ value); };
public string Name { get; set; }
member this.Name : string with get, set
Public Property Name As String

屬性值

預設值與類別名稱相同。

範例

[Table(Name = "Customers")]
public class Customer
{
    // ...
}
<Table(Name:="Customers")> _
Public Class Customer
    ' ...
End Class

備註

若未使用 Name,則表名稱與類別名稱同。

Note

你可以選擇使用結構名稱來限定資料表名稱(例如 Schema3.Table5)。 預設情況下,字串中第一個時期 Name 左側的標記被視為結構名稱,其餘則為資料表名稱。

以下範例中,預設資料表名稱 Customer,會被改為 Customers

適用於