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