OneOrMany<T> Structure
A collection of T that is optimized for minimal space in the case of a single element.
Assembly: Microsoft.VisualStudio.Utilities (in Microsoft.VisualStudio.Utilities.dll)
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of elements in the collection. |
![]() | Item[Int32] | Gets the element at the specified index in the collection. |
| Name | Description | |
|---|---|---|
![]() | Add(T) | Adds a new value to the collection. |
![]() | Equals(Object) | (Inherited from ValueType.) |
![]() | GetEnumerator() | Gets the enumerator for the collection. |
![]() | GetHashCode() | (Inherited from ValueType.) |
![]() | GetType() | (Inherited from Object.) |
![]() | RemoveAt(Int32) | Removes the item at the specified index from the collection. |
![]() | ToString() | (Inherited from ValueType.) |
While this type has a GetEnumerator method, it does not implement IEnumerable{T}. This is to eliminate any unintentional boxing that will happen if a value type is passed to or returned from a method via its interface. The collection may still be enumerated in foreach statements (since the compiler uses pattern matching for that), but not elsewhere (for example, LINQ expressions).
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

