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.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -