I have code (simplified)
Configuration:
_container.AddComponent<IRepository<Project>, FakeProjectRepository>();
var instance = new List<Project>();
_container.Kernel.AddComponentInstance<IList<Project>>(instance);
Class:
class FakeProjectRepository: IRepository<Project>
public FakeProjectRepository(IList<Project> entities)
{
_entities = entities.ToList();
}
While resolving container.Resolve(repositoryType) throws
Can't create component 'Domain.Concrete.FakeRepositories.FakeProjectRepository'
as it has dependencies to be satisfied.
Domain.Concrete.FakeRepositories.FakeProjectRepository
is waiting for the following dependencies:
Keys (components with specific keys)
- entities which was not registered.