C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
Java
Learn iOS Programming
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
5
Reply
Why we need Anonymous method?
Arunava Bhattacharjee
11y
5.2k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
for passing argument to the predicate type parameter , we nedd to implement the event handler with the same signature as the delegate. this will take sometime and complexity .so to reduce this anonymous method came. with the use of anonymous method you just specify the method implementation without method signature and return type ,the .net itself creates the eventhandler with the implementation specified in anonymous method. But Later lamda expression minimizes this also...
Sathiswaran
10y
1
An anonymous method is a method without a name - which is why it is called anonymous. You don't declare anonymous methods like regular methods. Instead they get hooked up directly to events. You'll see a code example shortly.To see the benefit of anonymous methods, you need to look at how they improve your development experience over using delegates. Think about all of the moving pieces there are with using delegates: you declare the delegate, write a method with a signature defined by the delegate interface, declare the event based on that delegate, and then write code to hook the handler method up to the delegate. With all this work to do, no wonder programmers, who are new to C# delegates, have to do a double-take to understand how they work.Because you can hook an anonymous method up to an event directly, a couple of the steps of working with delegates can be removed. The next section shows you how this works.
Ajay Gandhi
10y
0
Anonymous methods are unnamed methods used for creating delegates.
Sreeni Dony
10y
0
http://www.tutorialspoint.com/csharp/csharp_anonymous_methods.htm
Kml Surani
10y
0
http://www.tutorialspoint.com/csharp/csharp_anonymous_methods.htm
Munesh Sharma
11y
0
What is the difference between string.Empty and ""?Which one is best to use?
What is the difference between Lambda and Query Expression?
Message