Quantcast
Channel: Managed Extensibility Framework
Viewing all articles
Browse latest Browse all 265

New Post: Importing Multiple InheritedExport Interfaces

$
0
0

jpatrick62,

you need to apply the import attributes over each property as below. Two imports on the same property will not work as the composition engine will not know which import it should use to satisfy a property. If there are multiple Exports that can satisfy an import use the ImportMany attribute.

        [Import(typeof(Object1), AllowRecomposition = true)]
        private Object1 _obj1;
        [Import(typeof(Object2), AllowRecomposition = true)]
        private Object2  _obj2;

cheers

-alok


Viewing all articles
Browse latest Browse all 265

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>