Let me clear with my Question, I have say 100 classes all these 100 classes implements 1 interface say IDependency, say suppose my classname is Customer it implements IDependency
public class Customer : IDependency
public class Order:IDependency
it goes on till 100 classes
And I am registering this class in web.config like
<type type="IDependency" mapTo="Customer"></type>
<type type="IDependency" mapTo="Order"></type>
this will be wrong because i am getting error IDependency
already declared
Now what i need is there should be only 1 line in web.config and i should be able to resolve all my classes and I don't want to RegisterType
in my code like
Container.RegisterType<IDependency,Customer>();
Container.RegisterType<IDependency,Order>();
I don't want to write these lines in my code file the requirement is like that all should be done through config file.
Do you guys think is this valid if yes can you at least give me idea how to approach it.
Overall what i think is there should be 1 class say BaseClass
which implement my IDependency
Interface first and all my 100 classes will inherit that class and my config file should be like
<type type="IDependency" mapTo="BaseClass"></type>
Please let me know if you need more clarification on this because I am really struck with this