共用方式為


ObjectContext.IObjectContextAdapter.ObjectContext 屬性

[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]

傳回本身。 ObjectContext 會實作 IObjectContextAdapter,為 DbContext 和 ObjectContext 的提供通用介面,這兩者都會傳回基礎 ObjectContext。

命名空間:  System.Data.Entity.Core.Objects
組件:  EntityFramework (在 EntityFramework.dll 中)

語法

'宣告
<SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")> _
Private ReadOnly Property ObjectContext As ObjectContext 
    Implements IObjectContextAdapter.ObjectContext 
    Get
'用途
Dim instance As ObjectContext 
Dim value As ObjectContext 

value = CType(instance, IObjectContextAdapter).ObjectContext
[SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
ObjectContext IObjectContextAdapter.ObjectContext { get; }
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
private:
virtual property ObjectContext^ ObjectContext {
    ObjectContext^ get () sealed = IObjectContextAdapter::ObjectContext::get;
}
[<SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")>]
private abstract ObjectContext : ObjectContext
[<SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")>]
private override ObjectContext : ObjectContext
JScript supports the use of explicit interface implementations, but not the declarations of new ones.

屬性值

類型:System.Data.Entity.Core.Objects.ObjectContext

Implements

IObjectContextAdapter.ObjectContext

請參閱

參考

ObjectContext 類別

System.Data.Entity.Core.Objects 命名空間