共用方式為


ObjectStateManager.GetObjectStateEntries 方法

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

傳回具有給定狀態之物件或關聯性的 ObjectStateEntry 物件集合。

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

語法

'宣告
Public Overridable Function GetObjectStateEntries ( _
    state As EntityState _
) As IEnumerable(Of ObjectStateEntry)
'用途
Dim instance As ObjectStateManager 
Dim state As EntityState 
Dim returnValue As IEnumerable(Of ObjectStateEntry)

returnValue = instance.GetObjectStateEntries(state)
public virtual IEnumerable<ObjectStateEntry> GetObjectStateEntries(
    EntityState state
)
public:
virtual IEnumerable<ObjectStateEntry^>^ GetObjectStateEntries(
    EntityState state
)
abstract GetObjectStateEntries : 
        state:EntityState -> IEnumerable<ObjectStateEntry> 
override GetObjectStateEntries : 
        state:EntityState -> IEnumerable<ObjectStateEntry> 
public function GetObjectStateEntries(
    state : EntityState
) : IEnumerable<ObjectStateEntry>

參數

傳回值

類型:System.Collections.Generic.IEnumerable<ObjectStateEntry>
處於給定 ObjectStateEntry 中的 EntityState 物件集合。

例外狀況

例外狀況 條件
ArgumentException

當狀態為 Detached 時。

請參閱

參考

ObjectStateManager 類別

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