|
by BCL Team via BCL Team Blog on 11/1/2011 6:14:00 PM
This post discusses features in the preview version of MEF, and some details may change between now and the full release.
MEF ‘version 1’ uses attributes to describe how a type should be handled for composition purposes.
[Export, PartCreationPolicy(CreationPolicy.NonShared)]
public class HomeController : Controller
{
[ImportingConstructor]
public HomeController(/* Dependencies here */) { … }
public ActionResult Index() { … }
}
... [ read more ]
|