我在项目中将StructureMap用作IOC,我想检查以前未在StuctureMap中注册的每个接口。
我可以像下面这样使用TryGetInstance
,但我认为应该有更好的方法。
if (continer.TryGetInstance<TPluginType>() == null)
{
For<TPluginType>().Add<TPluggedType>();
}
有什么方法可以检查接口或类型是否已注册?
我在项目中将StructureMap用作IOC,我想检查以前未在StuctureMap中注册的每个接口。
我可以像下面这样使用TryGetInstance
,但我认为应该有更好的方法。
if (continer.TryGetInstance<TPluginType>() == null)
{
For<TPluginType>().Add<TPluggedType>();
}
有什么方法可以检查接口或类型是否已注册?