Extracted autofac generic decorator registration logic into an extension method.