This project has moved. For the latest updates, please go here.

Replacement for ExportCollection?

Jul 14, 2009 at 1:10 AM


I am new to MEF and am trying to work through an example I found that was built with an older version of MEF.

How would I rewrite the following code to work with MEF 6?  I think ExportCollection is no longer supported.

        ExportCollection<IOperation, IOperationData> operations;

Jul 14, 2009 at 2:57 AM

Use IEnumerable or an array of Lazy<T, TMetadata>:



//  IEnumerable
IEnumerable<Lazy<IOperation, IOperationData>> Operations;

// Array
Lazy<IOperation, IOperationData>[] Operations;

See this blog post for more information about what's changed in preview 6: