Share via


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)

Syntax

'Declaration
Public Sub New ( _
    parent As Entity, _
    memberName As String, _
    entityPredicate As Func(Of TEntity, Boolean) _
)
'Usage
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
)
public:
EntityCollection(
    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>
)

Parameters

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

Exceptions

Exception Condition
[ArgumentNullException]

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

Examples

<Association("Employee_Employee", "EmployeeID", "ManagerID")>
<XmlIgnore()>
Public ReadOnly Property Employee0 As EntityCollection(Of Employee)
    Get
        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")]
[XmlIgnore()]
public EntityCollection<Employee> Employee0
{
    get
    {
        if ((this._employee0 == null))
        {
            this._employee0 = new EntityCollection<Employee>(this, "Employee0", this.FilterEmployee0);
        }
        return this._employee0;
    }
}

See Also

Reference

EntityCollection<TEntity> Class

EntityCollection<TEntity> Overload

System.ServiceModel.DomainServices.Client Namespace