In this article, I describe what is polymorphism and when we use polymorphism in asp.net. polymorphism is one of the object oriented programming. It allows you to invoke derived class methods through a base class reference during runtime.
The following example describes how to implement yield return over foreach using c# .net. Create a method or a property with IEnumerable as the return type. Then somewhere in the method call yield return for each value you intent to have in the collection.