Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFCollection(T).Remove Method (T)

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFCollection(T).Remove Method (T)
Removes the first occurrence of a specific object from the collection.

Namespace:  OSIsoft.AF
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public bool Remove(
	T item
)
Public Function Remove ( 
	item As T
) As Boolean

Dim instance As AFCollection
Dim item As T
Dim returnValue As Boolean

returnValue = instance.Remove(item)
public:
virtual bool Remove(
	T item
) sealed
abstract Remove : 
        item : 'T -> bool 
override Remove : 
        item : 'T -> bool 

Parameters

item
Type: T
The object to remove from the collection. The value can be .

Return Value

Type: Boolean
Returns if item is successfully removed; otherwise . This method also returns if item was not found in the original collection.

Implements

ICollectionTRemove(T)

Remarks

This method determines equality using the default comparer Generic System.Collections.Generic.Comparer.Default. This comparer checks whether type T implements Generic System.IComparable and uses that implementation if available. If not, this comparer checks whether type T implements System.IComparable. If type T does not implement either interface, this method uses Equals(Object).

This method performs a linear search; therefore, the average execution time is proportional to Count. That is, this method is an O(n) operation, where n is Count.

If there is a need to delete many objects at once, it is better to delete them in bulk by using the delete method with a specified list of ids.

Version Information

AFSDK


See Also

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in