Is it possible to pass the requesting type as a parameter when configuring a StructureMap container.
For example:
container.Configure(x => {
x.For<ILogger>().Use(new TestLogger(log.Add, requestingType));
});
Where requesting type is the consuming object's type:
public class SomeClass
{
private readonly ILogger logger;
public SomeClass(ILogger logger)
{
this.logger = logger;
}
}
So the type passed to the logger would be SomeNamespace.SomeClass.
Thanks, Ben