How do I register something like this in the xml configuration (i know, i know, convention over config, but I’m supporting legacy code, so i need to do it in the xml config).
Specifically, I’m unclear on how to register AssignTechniciansFactory with the abstract base class AND the interface type. Normally, i get how to do it for either a base class OR just the interface. But how about registering both to the component?
public class AssignTechniciansFactory:
BaseAssignTechniciansFactory<Service>, IAssignTechniciansFactory
Where:
public class Service : BaseAssignTechnician
And:
public abstract class BaseAssignTechniciansFactory<T>
where T: BaseAssignTechnician
This is what I have, and I know it’s not correct:
<component id="assignTechniciansFactory"
service="MyNamespace.IAssignTechniciansFactory, MyAssembly"
type="MyNamespace.AssignTechniciansFactory, MyAssembly">
<parameters>
<dmq>${dmq}</dmq>
<builder>${builder}</builder>
</parameters>
</component>
In addition to what @adymitruk said, you can specify additional services for a component via
forwardedTypeselement in XML configuration.