I have a repository factory NhRepositoryFactory
public interface IRepositoryFactory
{
IRepository<T> Create<T>() where T: Entity;
}
public class NhRepositoryFactory: IRepositoryFactory
{
public IRepository<T> Create<T>() where T : Entity
{
return new NhRepository<T>();
}
}
In order to resolve some repositories dependencies I want to get them from the Autofac container. So I should somehow inject Func<IRepository<T>>
factory into my class. How can I accomplish this?
Thanks in advance.