Quantcast
Channel: #Zyan Communication Framework
Viewing all articles
Browse latest Browse all 665

New Post: [de] Singleton bei Verwendung von .RegisterComponents

$
0
0
Hi!

MEF integration relies on standard MEF attributes, located in System.ComponentModel.Composition namespace.
PartCreationPolicyAttribute(CreationPolicy.Shared) will do the trick:
// this component will work as a singleton (one instance per composition container)
[ZyanComponent(typeof(ISampleService)), PartCreationPolicy(CreationPolicy.Shared)]
internalclass MySampleService : ISampleService

Viewing all articles
Browse latest Browse all 665

Latest Images

Trending Articles



Latest Images

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