.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

XPCollection.AddRange(ICollection) Method

Adds each element from a specified collection of persistent objects to the XPCollection.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v21.2.dll


public void AddRange(
    ICollection objects


Name Type Description
objects ICollection

An ICollection object, which is a collection of persistent objects to add to the XPCollection.


A persistent object is an object that implements the IXPSimpleObject interface or has the PersistentAttribute attribute.

You cannot add objects whose type is not the same or not inherited from the type specified by the XPCollection.ObjectClassInfo property. Also, you cannot add an object more than once. Doing so does not lead to an exception, but the object will not be added to the collection.

While the XPCollection is loading, it contains objects that match specific criteria. When you add objects, the collection does not check whether they match the criteria or not.

See Also