Resolving the Generic Service

advertisements

I got the following service:

IRepository<TEntity, TPrimaryKey>

..for which I've created an implementation defined as:

Repository<TEntity, TPrimaryKey>.

How do I register it in autofac so that I can resolve it as:

IRepository<User, int>


builder.RegisterGeneric(typeof (Repository<,>)).As(typeof (IRepository<,>));

I love autofac.