Quantcast
Channel: CommonServiceLocator
Viewing all articles
Browse latest Browse all 118

Commented Issue: No Support for IsRegistered (or HasMapping) [14016]

$
0
0
It would be a really handy addition to be able to request if the container has a registration for for a particular situation. The specific need I have at the moment is that I want to be able to ask for a registration by name; if no specific registration exists for that name then I want to use the default, nameless registration. In this case it's all about using IoC to provide testability; I want to register a default container for an object that performs access to the database and then override this during testing with specific classes that fake the data access results I need for each test.

I have created a sample class that shows the situation I am trying to support through the service locator; I can do this with Unity but can't do it in an agnostic way through CommonServiceLocator
Comments: ** Comment from web user: dot_NET_Junkie **

I suspect you are taking the wrong approach, but the issue tracker is the wrong place to discuss this. The best place to discuss this is on Stackoverflow. Describe your situation (type of application) with some code examples and say that you can't accomplish this with the CSL and ask if you are taking the right approach. Tag your question with ".net c# ioc-container common-service-locator dependency-injection" and you will get one or more high quality answers very soon.


Viewing all articles
Browse latest Browse all 118

Trending Articles



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