EntitySet<TEntity> Class

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Represents a collection of Entity instances that provides change tracking and other services.

Inheritance Hierarchy

System.Object
  System.ServiceModel.DomainServices.Client.EntitySet
    System.ServiceModel.DomainServices.Client.EntitySet<TEntity>

Namespace:  System.ServiceModel.DomainServices.Client
Assembly:  System.ServiceModel.DomainServices.Client (in System.ServiceModel.DomainServices.Client.dll)

Syntax

'Declaration
Public NotInheritable Class EntitySet(Of TEntity As Entity) _
    Inherits EntitySet _
    Implements IEnumerable(Of TEntity), IEnumerable, ICollectionViewFactory
'Usage
Dim instance As EntitySet(Of TEntity)
public sealed class EntitySet<TEntity> : EntitySet, 
    IEnumerable<TEntity>, IEnumerable, ICollectionViewFactory
where TEntity : Entity
generic<typename TEntity>
where TEntity : Entity
public ref class EntitySet sealed : public EntitySet, 
    IEnumerable<TEntity>, IEnumerable, ICollectionViewFactory
[<SealedAttribute>]
type EntitySet<'TEntity when 'TEntity : Entity> =  
    class
        inherit EntitySet
        interface IEnumerable<'TEntity>
        interface IEnumerable
        interface ICollectionViewFactory
    end
JScript does not support generic types and methods.

Type Parameters

  • TEntity
    The type of Entity this entity set will contain.

The EntitySet<TEntity> type exposes the following members.

Constructors

  Name Description
Public method EntitySet<TEntity> Initializes a new instance of EntitySet<TEntity> class.

Top

Properties

  Name Description
Public property CanAdd Gets a value indicating whether the set allows new entities to be added. (Inherited from EntitySet.)
Public property CanEdit Gets a value indicating whether entities in the set can be edited. (Inherited from EntitySet.)
Public property CanRemove Gets a value indicating whether the set allows entities to be removed. (Inherited from EntitySet.)
Public property Count Gets the current count of entities in the set. (Inherited from EntitySet.)
Public property EntityContainer Gets the container for this EntitySet. (Inherited from EntitySet.)
Public property EntityType Gets the type of entity contained by this EntitySet. (Inherited from EntitySet.)
Public property HasChanges Gets a value indicating whether this EntitySet currently has any pending changes. (Inherited from EntitySet.)
Public property IsReadOnly Gets a value indicating whether this set supports update operations. (Inherited from EntitySet.)
Protected property List Gets the backing list for this EntitySet. (Inherited from EntitySet.)

Top

Methods

  Name Description
Protected method AcceptChanges Accepts all changes made to this EntitySet. (Inherited from EntitySet.)
Public method Add(TEntity) Adds the specified entity to this entity set. Also, recursively adds all unattached entities that are reachable through associations.
Public method Add(Entity) Adds the specified Entity to this EntitySet. (Inherited from EntitySet.)
Public method Attach(TEntity) Attaches the specified Entity to this entity set in an unmodified state. Also, recursively attaches all unattached entities that are reachable through associations.
Public method Attach(Entity) Attaches the specified Entity to this EntitySet in an unmodified state. (Inherited from EntitySet.)
Public method Clear Clears all entities from the set. (Inherited from EntitySet.)
Protected method CreateEntity Creates a new entity. (Inherited from EntitySet.)
Protected method CreateList Creates the storage list for the set. (Inherited from EntitySet.)
Public method Detach(TEntity) Detaches the Entity from this entity set.
Public method Detach(Entity) Detaches the specified Entity from this EntitySet. (Inherited from EntitySet.)
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetEnumerator Returns an enumerator for this entity set.
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Protected method OnCollectionChanged Called whenever the collection changes. (Inherited from EntitySet.)
Protected method OnPropertyChanged Called when an EntitySet property has changed. (Inherited from EntitySet.)
Protected method RaisePropertyChanged Raises the PropertyChanged event for the specified property. (Inherited from EntitySet.)
Protected method RejectChanges Reverts all changes made to this EntitySet. (Inherited from EntitySet.)
Public method Remove(TEntity) Removes the specified entity from the set. If the entity is the root of a compositional hierarchy, all child entities will also be removed.
Public method Remove(Entity) Removes the specified entity from the set. (Inherited from EntitySet.)
Public method ToString (Inherited from Object.)

Top

Events

  Name Description
Public event EntityAdded Occurs when an Entity is added to this entity set.
Public event EntityRemoved Occurs when an Entity is removed from this entity set.
Public event PropertyChanged Occurs when a property is changed. (Inherited from EntitySet.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IChangeTracking.AcceptChanges Resets the object’s state to unchanged by accepting the modifications. (Inherited from EntitySet.)
Explicit interface implemetationPrivate event INotifyCollectionChanged.CollectionChanged Occurs when the collection is changed, or is reset. (Inherited from EntitySet.)
Explicit interface implemetationPrivate method ICollectionViewFactory.CreateView Returns a custom view for specialized sorting, filtering, grouping, and currency.
Explicit interface implemetationPrivate method IEnumerable.GetEnumerator Returns an enumerator that iterates through a collection. (Inherited from EntitySet.)
Explicit interface implemetationPrivate method IEnumerable<TEntity>.GetEnumerator Returns an enumerator for this entity set.
Explicit interface implemetationPrivate property IChangeTracking.IsChanged Gets the object's changed status. (Inherited from EntitySet.)
Explicit interface implemetationPrivate method IRevertibleChangeTracking.RejectChanges Resets the object’s state to unchanged by rejecting the modifications. (Inherited from EntitySet.)

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.ServiceModel.DomainServices.Client Namespace