You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I was trying to do a conditional check(to see if a class was exported) for null off of container.Locate() but it was creating a new instance of that class when I called it(even though the Type hasn't been exported yet). Would I call keys and then check off the Type to see if a key exists for the Type I want to add?
The text was updated successfully, but these errors were encountered:
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.
So I was trying to do a conditional check(to see if a class was exported) for null off of container.Locate() but it was creating a new instance of that class when I called it(even though the Type hasn't been exported yet). Would I call keys and then check off the Type to see if a key exists for the Type I want to add?
The text was updated successfully, but these errors were encountered: