ImportOptions.ReferencedCollectionTypes Property

Definition

Gets a collection of types that represents data contract collections that should be referenced when generating code for collections, such as lists or dictionaries of items.

C#
public System.Collections.Generic.ICollection<Type> ReferencedCollectionTypes { get; }

Property Value

An ICollection<T> that contains the referenced collection types.

Remarks

By default, an array will be generated when importing a collection schema (unless the schema has a special annotation that mentions a different type). However, if there is a matching type in the ReferencedCollectionTypes collection, that type will be used. For example, when importing schema that contains a list of integers, an array of integers will normally be generated. However, if the collection contains the LinkedList<T> of type integer, that type will be used instead of the array.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1