Im new to Autofac and finding myself repeating a lot of this....
builder.RegisterType<ConcreteService<EntityA>>().As<IService<EntityA>>();
builder.RegisterType<ConcreteService<EntityB>>().As<IService<EntityB>>();
EntityA
, EntityB
, EntityC
and so on.. all inherit from EntityBase
, so i want to instruct Autofac to always use ConcreteService<x>
when it needs to create an implementation of IService<x>
as long as x inherits from EntityBase
I am aware that the AssemblyScanner in Autofac may be able to help with this, although i am struggling to find documentation that goes far enough into it.
Any pointers appreciated.