I have an interface:
public interface IInterface
{
string Get(obj o);
}
and I have the 2 classes:
public class C1 : IInterface
{
string Get(obj o);
}
public class C2 : IInterface
{
string Get(obj o);
}
I'd like to send in o and then have Ninject determine which interface it is based on the property of o. Obj being something like:
public class obj
{
public string Name {get;set;}
public int Id {get;set;}
}
I'd like something that's like:
Bind<IInterface>().To<C1>.When(obj.Name == "C1");
Bind<IInterface>().To<C2>.When(obj.Name == "C2");
but I haven't worked with Ninject before. Any ideas?