2 Interfaces on same singleton class, configure in config file

Dec 6, 2012 at 8:22 AM


I had a class with implement two Interfaces.

Via code I can ensure to bind each interface on a singleton instance of the class)

var container = new UnityContainer(); 
var instance = container.Resolve<DoIt>();
var objA = container.Resolve<ISomethingA>();
var objB = container.Resolve<ISomethingB>();

public class DoIt : ISomethingA, ISomethingB { 
public void xxx() { }
public void yyy() { }
public interface ISomethingA { void xxx(); } 
public interface ISomethingB { void yyy(); }
But I want this piece of code in the config.exe file
How can I do this ?
Many thanks
Dec 6, 2012 at 10:49 AM


know its working!

Mapping two Interfaces on the same class in the config file do the job.

With .Resolve<Interface> there will be one instance.