# IdList<T> class

Namespace: [Grasshopper2.Collections](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.collections.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class IdList<T>
```

A fast dictionary for objects with GUID keys. This type differs from Dictionary(Guid, T) by sacrificing memory for lookup performance. Adding entries may be slower and require more allocations, however finding entries ought to be slightly faster. This collection is not thread-safe and any modifying calls must be made from within a lock statement.

**Type parameters:**

- `T`

## Constructors

- [IdList<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.idlist-1/ctor.md): Create a new, empty collection.

## Properties

- [Count](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.idlist-1/count.md): Gets the number of objects stored in this collection.
- [Values](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.idlist-1/values.md): Enumerate over all instances of T stored in this collection

## Methods

- [Add](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.idlist-1/add.md): Add a new instance to this collection. If another instance with the same ID is already part of this collection, nothing will happen.
- [Clear](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.idlist-1/clear.md): Clear all values.
- [Contains](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.idlist-1/contains.md): (2 overloads) Test whether a given key exists within this collection.
- [Find](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.idlist-1/find.md): Retrieve the instance which matches the ID.
- [Remove](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.idlist-1/remove.md): (2 overloads) Remove the instance which is associated with the given ID.
- [Set](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.idlist-1/set.md): Add a new instance to this collection. Any existing instance with a matching key will be overwritten.
- [ToArray](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.idlist-1/toarray.md): Convert this list into an array.
- [Update](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.idlist-1/update.md): Update a value at an old ID. This may be necessary if a value stored inside this collection has mutated and now resolves to a different ID.
