I have some classes like UserQuery, CustomerQuery implementing interfaces like IUserQuery, ICustomerQuery respectively. In my binding configuration I need to bind every interface with the respectively query:
builder.RegisterType<UserQuery>().As<IUserQuery>().InstancePerRequest();
builder.RegisterType<CustomerQuery>().As<ICustomerQuery>().InstancePerRequest();
This is working pretty fine, but I was wondering if there is a way to make a convention-based binding in place of binding every single classe XXX[Query] -> [I]XXX[Query].
I'm using AutoFac as my DI container.