Skip to main content
3 of 6
added 221 characters in body
Gulshan
  • 9.5k
  • 10
  • 61
  • 89

When to use abstract classes instead of interfaces and extension methods in C#?

"Abstract class" and "interface" are similar type of ideas, while interface being more abstract. One need of abstract classes was to provide method implementations for the derived classes. But in C#, that need has also been reduced by lately introduced extension methods. So, in C#, when should we use abstract classes instead of using interfaces and extension methods associated with the interface?

And now, we can use 'Properties' in interfaces also. A notable example of interface+ extension methods is the Heavily used IEnumerable and it's helper methods. You use Linq and it's all by this extension methods!

Gulshan
  • 9.5k
  • 10
  • 61
  • 89