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
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.
精彩评论