Extension methods give us an easy way to add a new method to an existing class or type without having to modify the original class or type. Besides, we don't need to recompile the code since just after we create the extension method it will be recognized by the code in the project. An extension method has to be declared as a static method inside a static class. As there is no apparent difference compared to the existing methods in a class or type, the method will also appear in the IntelliSense.
Extension methods can also be declared in another assembly, and we have to refer to the namespace of the static class defined the method stored in the other assemblies. However, we can use the piggyback namespace technique, which uses the existing namespace so that we don't need to refer to any other namespace anymore. Not only can we extend the class and type functionality, but we can also extend the interface, collection, and any objects in the framework.
Like other C# technologies, extension...