I have a constructor that take two interfaces, they are the same interface, but need to be different implementations:
public class Foo
{
public Foo(IBar publicData, IBar privateData)
{
}
}
What I'd like to happen is that structuremap would pass in a concrete implementation of IBar
as class PublicData
and class PrivateData
for the different arguments. Is this possible?
UPDATE
In fact, to make sure there is enough information:
The real classes that I'm working with look like this:
public abstract class EFRepository<T> : IRepository<T>
{
protected EFRepository(IUnitOfWork publicUnitOfWork,
IUnitOfWork privateUnitOfWork)
{
}
}
And an implementation of EFRepository
might look like this:
public partial class ClaimRepository: EFRepository<Claim>, IClaimRepository
{
public ClaimRepository(IUnitOfWork publishedUnitOfWork,
IUnitOfWork unpublisedUnitOfWork)
: base(publishedUnitOfWork, unpublisedUnitOfWork)
{
}
}
So when I request and instance of IClaimRepository
from structure map I want the implementation to be given the correct unit of work objects, which in my instance are essentially two different databases, so it's the same code with different connection strings.