Duration: 16 minutes
Summary: In this video, Normally we write extension methods for classes, but in this example, we will see how that works with interfaces. We create a Student class, and an IStudent interface. The class StudentCollection implements the IStudent interface. The static class StudentExtension adds an extension method to the IStudent interface. In Main(), we create a StudentCollection and add students to it. Then, we show in two different ways how to call the PrintStudent() extension method.
Methodology of the development of example: Good coding standard and simplified design.
Technology Used: C# 4.0
Keywords: C#, System, class, interface, new, override, List, extension method.