DbSet<TEntity>.Local Property

[This page is specific to the Entity Framework version 6. The latest version is available as the 'Entity Framework' NuGet package. For more information about Entity Framework, see msdn.com/data/ef.]

Gets an ObservableCollection<T> that represents a local view of all Added, Unchanged, and Modified entities in this set. This local view will stay in sync as entities are added or removed from the context. Likewise, entities added to or removed from the local view will automatically be added to or removed from the context.

Namespace:  System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

Syntax

'Declaration
Public Overridable ReadOnly Property Local As ObservableCollection(Of TEntity)
    Get
'Usage
Dim instance As DbSet 
Dim value As ObservableCollection(Of TEntity)

value = instance.Local
public virtual ObservableCollection<TEntity> Local { get; }
public:
virtual property ObservableCollection<TEntity>^ Local {
    ObservableCollection<TEntity>^ get ();
}
abstract Local : ObservableCollection<'TEntity>
override Local : ObservableCollection<'TEntity>
function get Local () : ObservableCollection<TEntity>

Property Value

Type: System.Collections.ObjectModel.ObservableCollection<TEntity>
The local view.

Implements

IDbSet<TEntity>.Local

Remarks

This property can be used for data binding by populating the set with data, for example by using the Load extension method, and then binding to the local data through this property. For WPF bind to this property directly. For Windows Forms bind to the result of calling ToBindingList on this property.

See Also

Reference

DbSet<TEntity> Class

System.Data.Entity Namespace