MEF Why is ComposePart an extension method?

Posted by ILovePaperTowels on Stack Overflow See other posts from Stack Overflow or by ILovePaperTowels
Published on 2012-06-21T03:12:28Z Indexed on 2012/06/21 3:16 UTC
Read the original article Hit count: 138

Filed under:
|

CompositionContainer.ComposePart is an extension method. why is that? Looking into the System.Componentmodel.Composition assembly, it looks like it's because it is ONLY meant to work with the attributed programming model while the .Compose() method is able to take in exports as long as it is a composablepart. ComposePart is even hosted in the 'AttributedModelServices' class which makes me think I'm correct.

Am I correct on this? If not, why is it an extension method and not a method in the container class?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about MEF