开发者

What's the difference between GetService and GetInstance in CSL

I'm coding against Common Service Locator and I'm having trouble figuring out the semantic differences between GetInstance, GetAllIns开发者_StackOverflowtances, and GetService (GetAllInstances is pretty obvious, but both GetInstance and GetService seem to return an object).

For example, what are the MEF equivalents of these three methods?


There is no semantic difference between:

  • GetService(Type serviceType)
  • GetInstance(Type serviceType)
  • GetInstance<TService>()

All of them call GetInstance(serviceType, null) internally.

Also the reference doesn't even mention the GetService method. http://commonservicelocator.codeplex.com/wikipage?title=API%20Reference&referringTitle=Home

You can always check the source code: http://commonservicelocator.codeplex.com/SourceControl/changeset/view/27688#332684

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜