Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
特定のタイプが StructureMap で構成されているかどうかを判断する方法はありますか?
StructureMap で具体的に構成されていない場合は、ジェネリック型を返したいです。
v2.6 では、次のことが必要です。
IContainer.Model.HasImplementationsFor(serviceType)
StructureMap バージョン 2.5.1 から、不明な場合のデフォルト値を返すTryGetInstance<T>()andがあります。TryGetNamedInstance<T>()TT
TryGetInstance<T>()
TryGetNamedInstance<T>()
T