开发者

List of all objects in my Unity DI Container

Is there a way to have a list of all objects registered in my开发者_StackOverflow中文版 DI Container. ResolveAll gives a list for a type but I want a general list for all types


Well, you can't get a list of all objects, because objects aren't registered, types are. Unity 2.0 added the UnityContainer.Registrations property you can use to look at what's in the container.

Be warned there's a known bug right now if you have open generics registered which causes the Registrations property to throw an exception.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜