Browse by Tags

All Tags » Dependency Injection (RSS)

Binding private and internal members using the CompositionContainer

By default, the CompositionContainer will not bind to private and internal members. For example, given the following fictional class: public class ConnectionFactory { [ Import ( "ConnectionString" )] private string _ConnectionString; public...

Dependency Injection in the Managed Extensibility Framework – Named Contracts

This is part three in a series of posts on dependency injection in the Managed Extensibility Framework (MEF). You can find other posts in the series here: Dependency Injection in the Managed Extensibility Framework – Simple Injection Dependency Injection...

Dependency Injection in the Managed Extensibility Framework – Optional Injection

This is part two in a series of posts on dependency injection in the Managed Extensibility Framework (MEF). You can find other posts in the series here: Dependency Injection in the Managed Extensibility Framework – Simple Injection Dependency Injection...

Customer Question – Does MEF allow injection without using attributes?

Peter Richie asks: “ MEF allows decoupling of TypeA's dependency on TypeB, but now TypeA and TypeB have an assembly-level dependency on the MEF assemblies. If I have a specific restriction on deployment of the assemblies required by TypeB such...

Dependency Injection in the Managed Extensibility Framework – Simple Injection

This is part one in a series of posts on dependency injection in the Managed Extensibility Framework (MEF). You can find other posts in the series here: Dependency Injection in the Managed Extensibility Framework – Simple Injection Dependency Injection...