If I register a bunch of data structures with an IoC container, I'd like to say (C# syntax):
var lookup = container.Create<IDictionary<Name,ISequence<EMail>>>() ;
The container should magically find the registered types that implement IDictionary and ISequence, and construct the type I need. Basically, I want to create types based on interfaces and have the container figure out which concrete types will fulfill my requirements.
[edit] I've got an interface layer that defines many types, and several implementation layers. I want to load a particular implementation and have the container automagically figure out that IExpr can be resolved with CExpr (or RubyExpr or PythonExpr). If it's ambiguous then raise an exception.
Has anyone with experience with Java or .NET IoC container frameworks seen one that can do this? Thanks.