关于MEF的[PartCreationPolicy(CreationPolicy.Shared)]

今天调试MEF的时候发现怎么给我把实例缓存起来了!
气死我了。
于是上网查了一通,原来是CreationPolicy搞的
[PartCreationPolicy(CreationPolicy.Shared)]
这个概念果然是第一次接触
恩,又有前途
CreationPolicy分为Shared和NotShared
默认是Shared
两个都很有用,善用的话既IOC又可以代替缓存。哇哈
MEF做的越来越牛逼了

2 comments

  1. Gabriel Souliere 说道:

    I just want to mention I am just new to weblog and really liked your web-site. More than likely I’m want to bookmark your website . You really have fantastic well written articles. Thanks a bunch for revealing your blog.

  2. Livia Stamp 说道:

    At this time it looks like Drupal is the top blogging platform available right now. (from what I’ve read) Is that what you are using on your blog?

发表评论

电子邮件地址不会被公开。