TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Bijayani Baijayanti
NA
14
0
Usage of Extension Methods in C# 3.5
Jun 16 2010 9:39 AM
Introduction:
C# 3.0
provides a new feature called Extension Methods. Extension methods are methods that can be added to previously defined classes without rebuilding/compiling those classes.
Process: To define an extension method, we first define a static class, Then we define our static method which is meant to be extended. The first parameter of the extension class should be the type of Object we need to extend.
Syntax:
public static <Return Type> <Function Name>(this <Object Type> <Variable Name>)
{
Do Something
.........
......
return <Return Type> ;
}
Hope you find this tips useful.
Thanks,
Bijayani
Reply
Answers (
0
)
Developing a network application with C# And SQL SERVER 2005
Enumeration with return of prop name & value