What is extension method in c# and how to use them? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 8

What is extension method in c# and how to use them?

23rd Dec 2017, 10:34 AM
Abhivarshini Maddala
Abhivarshini Maddala - avatar
3 Answers
+ 1
enable you to add methods to existing types without creating a new derived type ....it just go through whether you want any of the data type for globally or locally assign in the program
24th Dec 2017, 9:36 AM
Yesh Jadav
Yesh Jadav - avatar
+ 1
Extension inherits from the superclass so there is no need to define the properties, attributes again. Now you can just instantiate via the constructor.
25th Dec 2017, 3:59 AM
Jeffrey Koh
Jeffrey Koh - avatar