Articles → .NET → Extension Method In C#
Extension Method In C#
- Create a custom class and add a method IsEvenNumber in it.
- Create extension methods.
Create A Custom Class
Create Extension Method
- Create a static class.
- Inside the class create a static method.
- Pass an argument of any data type of which you want to write the extension method prefixed by this keyword.