0
kicks
LINQing to MEF Imports
At the end of the last post, we looked at how we can explicitly manage our imports and exports using a combination of text-based labels and type declarations. In addition, we began to look at the ImportMany() attribute for importing more than one value in our extensible application. Along with the ImportMany(), we looked at looping through the simple example to display the property of each imported type. This approach isn't bad if the number of imported types are small; however, looping really wouldn't work well if your application loaded a very large amount of applications. In a way, it's a great problem to have if your application has a large community based plug-in repository (i.e. Wordpress or Firefox). There may come a time when we may need to find a specific plug-in without looping through everything. In order to determine this, there's a couple different ways to handling this. In this post, we're going to explore a non-MEF way of handling it using LINQ. In a future post, we'll look at how we can expand upon this using some of the constructs that MEF provides.