EntityConnection.StoreConnection 屬性

定義

提供基礎資料來源連接的存取 (EntityConnection 物件會使用該連接)。

public:
 property System::Data::Common::DbConnection ^ StoreConnection { System::Data::Common::DbConnection ^ get(); };
public System.Data.Common.DbConnection StoreConnection { get; }
member this.StoreConnection : System.Data.Common.DbConnection
Public ReadOnly Property StoreConnection As DbConnection

屬性值

資料來源連接的 DbConnection

備註

如果關閉 EntityConnection 物件,將會關閉傳回的資料來源連接。 如果開啟它,將會傳回開啟的資料來源連接。 如果設定了資料來源連接資訊,傳回的值一定不是 null。 例如,如果沒有數據源連接資訊 (,如果使用無參數建構函式,且之後未設定任何 連接字串) ,則會傳回 null 參考。

Entity Framework 所使用的相同資料來源連接可以與應用程式的其他部分共用。 資料來源連接會以 DbConnection 物件的形式從 ConnectionObjectContext 屬性或是從 StoreConnectionEntityConnection 屬性傳回。

適用於