I have the following Service class constructor:
public class Service : IService
{
private readonly IRepository _repository;
public Service(IRepository repository)
{
_repository = repository;
}
// ...
}
IRepository has two named implementations. I want to Resolve IService but need to set which IRepository implementation should be used (Service should be flexible and I can't put Dependency attribute to IRepository constructor parameter).
Is there any way to implement it by Unity?