Grace
Grace copied to clipboard
How to tell if there is an instance of a class exported?
So I was trying to do a conditional check(to see if a class was exported) for null off of container.Locate
I'm assuming the type you were testing for was a class and not an interface. The container will auto resolve concrete classes. You can turn the feature off like this.
var container = new DependencyInjectionContainer(c => c.AutoRegisterUnknown = false);
The other option would be to look at the container.StrategyCollectionContainer collection and test if your type has been registered.