Consider interfaces:
public interface IOne{}
public interface ITwo{}
public interface IBoth : IOne, ITwo{}
And class
public class Both : IBoth{}
But when I need to resolve base interfaces I need to register both interfaces in container
<register type="IOne" MapTo="Both"/>
<register type="ITwo" MapTo="Both"/>
The question is - can I deduplicate the registration in a way like this:
<register type="IBoth" MapTo="Both"/>
But resolve it in different places from different interfaces:
var o = containet.Resolve<IOne>();
var t = containet.Resolve<ITwo>();
Can I do such a trick in any other way since this scenario is not working?...
Short answer: You can't. Long answer: You can write a custom container extension that does this kind of trick for you.
You will need to fine-tune the extension in order to catch registration of interfaces like
IDisposable
or overwriting an already existing registration for a given interface.