SteveCl
SteveCl

Reputation: 4569

Using MEF, inject into an Import class

I have a logger interface that I inject into many different classes, can I inject that class in say a repository class, which is also an Import class which is injected into other classes?

Hope that makes sense, I'm a little confused by it myself.

Thx

Upvotes: 1

Views: 602

Answers (1)

Mark Seemann
Mark Seemann

Reputation: 233135

Yes, a class can both import and export parts.

Glenn Block explains it well in his article Managed Extensibility Framework: Building Composable Apps in .NET 4 with the Managed Extensibility Framework.

Upvotes: 2

Related Questions