0
ivanosw1 created
Hi, I've created a generic interface with implementation:
public interface IAggregateRepository<T, in TPrimaryKey> : ITransientDependency where T : IAggregateRoot
...
public class ConfigurazioneRepository : IAggregateRepository<Configurazione,long>
....
When I try to inject IAggragateRoot<Configurazione, long>, Castle says that it has dependencies to be satisfied and is waiting for the following dependencies.
But if I register it manually it works.
IocManager.Register<IAggregateRepository<Configurazione, long>, ConfigurazioneRepository>(DependencyLifeStyle.Transient);
The question is: how can I register a generic interface like IRepository<T> ?
Thanks
1 Answer(s)
-
0
Generic types are not registered by convention. Even IRepository<> has long been registered explicitly by ABP.
But here's how you can: https://github.com/aspnetboilerplate/aspnetboilerplate/issues/2125#issuecomment-307132637
Have an answer to this question?
Log in
and write your answer.