EntityCollection<TEntity> Constructor (Entity, String, Func<TEntity, Boolean>)

[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.]

Initializes a new instance of the EntityCollection<TEntity> class with the specified parent, name of the collection on the parent, and filter function.

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


Public Sub New ( _
    parent As Entity, _
    memberName As String, _
    entityPredicate As Func(Of TEntity, Boolean) _
Dim parent As Entity
Dim memberName As String
Dim entityPredicate As Func(Of TEntity, Boolean)

Dim instance As New EntityCollection(parent, _
    memberName, entityPredicate)
public EntityCollection(
    Entity parent,
    string memberName,
    Func<TEntity, bool> entityPredicate
    Entity^ parent, 
    String^ memberName, 
    Func<TEntity, bool>^ entityPredicate
new : 
        parent:Entity * 
        memberName:string * 
        entityPredicate:Func<'TEntity, bool> -> EntityCollection
public function EntityCollection(
    parent : Entity, 
    memberName : String, 
    entityPredicate : Func<TEntity, boolean>


  • entityPredicate
    Type: System.Func<TEntity, Boolean>
    The function used to filter the associated entities and determine which entities are members of this collection.


Exception Condition

parent, memberName, or entityPredicate is nulla null reference (Nothing in Visual Basic).


<Association("Employee_Employee", "EmployeeID", "ManagerID")>
Public ReadOnly Property Employee0 As EntityCollection(Of Employee)
        If Me._employee0 = Nothing Then
            Me._employee0 = New EntityCollection(Of Employee)(Me, "Employee0", Me.FilterEmployee0);
        End If
    End Get
End Property
[Association("Employee_Employee", "EmployeeID", "ManagerID")]
public EntityCollection<Employee> Employee0
        if ((this._employee0 == null))
            this._employee0 = new EntityCollection<Employee>(this, "Employee0", this.FilterEmployee0);
        return this._employee0;

See Also


EntityCollection<TEntity> Class

EntityCollection<TEntity> Overload

System.ServiceModel.DomainServices.Client Namespace