StructureMap singleton usage (A class implementing two interface)

You can use the Forward<,>() registration to tell StructureMap to resolve a type using the resolution of a different type. This should do what you expect:

ObjectFactory.Initialize(x =>
{
    x.For<IInterface1>().Singleton().Use<MyClass>();
    x.Forward<IInterface1, IInterface2>();
});

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)