Extension method in c# -
this question has answer here:
what difference between following 2 implementaion,if no difference why need extension methods ? (public static list<tsource> tolist<tsource>(this ienumerable<tsource> source
);)
1.ienumerable<student> myextension = mtystudent; // "mtystudent colletion" myextension.tolist(); 2.list<student> mystudent= enumerable.tolist(myextension);
there no difference. call same method either way. enumerable.tolist<tsource>(this ienumerable<tsource> source)
extension method. static method in enumerable
class, can call instance method. extension methods really.