Extension methods in LINQ
Why Extensions method are used in LINQ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Jan 3, 2012, 4:05 AM
Extension method used to customize, behaviour of exsiting and new method which is used frequently.
for example.
string have ToString() method, as we know that ToString does not handle null condition. you may write your extension method which may also handle null.
it help us to reduce code(like functions).
hope this help.
VulpesPosted Oct 12, 2011, 4:23 AM
Pravin MorePosted Oct 12, 2011, 12:42 AM
Extension methods are used to change behaviour of existing .net type according to need means you can customize it.
For example, you may decide that you don't like the way where works, so you add a new where to your code that provides the functionality you want. This feature can significantly change the way LINQ works and make your coding significantly easier by customizing it.
e.g IEnumerable
Thanx,hope it will help you.
Pravin.