CollectionAdapters::ToIList<TContract, TView> Method (IListContract<TContract>^, Converter<TContract, TView>^, Converter<TView, TContract>^)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Converts a specified IListContract<T> collection to an IList<T> collection by using converter adapters.

Namespace:   System.AddIn.Pipeline
Assembly:  System.AddIn (in System.AddIn.dll)

generic<typename TContract, typename TView>
static IList<TView>^ ToIList(
	IListContract<TContract>^ collection,
	Converter<TContract, TView>^ contractViewAdapter,
	Converter<TView, TContract>^ viewContractAdapter


Type: System.AddIn.Contract::IListContract<TContract>^

The collection to pass to the other side of the pipeline.

Type: System::Converter<TContract, TView>^

A converter that adapts the data from the type defined in the contract to the type expected in the view.

Type: System::Converter<TView, TContract>^

A converter that adapts the data from the type defined in the view to the type expected by the contract.

Return Value

Type: System.Collections.Generic::IList<TView>^

The converted collection.

Type Parameters


The type that defines the view of the objects in the list.


The type that defines the contract for passing objects of type TView across the isolation boundary.

Use this method overload for IListContract<T> collections that contain types that must be adapted before they can be passed to the add-in or host (rather than simple serializable types that can be passed directly). The host application or add-in can use the returned IList<T> collection. It will have a lifetime token for the remote IListContract<T>.

.NET Framework
Available since 3.5
Return to top