Replace If with Polymorphism with AutoFac DI Container


As the title specifies we will be Replacing the conditional if and Switch statement with the help of Polymorphism using DI container and talk about the benefits of doing the same in this article. Oops gives us pretty much great features which we are aware of theoretically but never implements practically. Polymorphism is one of the main features provided by Object-Oriented Languages which in turn implies that a Parent class can have more than one behavior and can point towards its child classes at runtime. If you want to learn more about OOPS features, you can go through below blog which talks about oops and other features. Continue reading