Click here to Skip to main content
15,889,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
what is the different when we pass a method into in the select statement and an anonymous method in the select statement in over the list. how anonymous handle by the select.

Please forgive me if it confuse anyone. Thanks.
Posted

Basically, except for some limitations, and advanatages, anonymous methods are like normal methods. This would also be true when using the for LINQ. Some of the differences are:

1) In anonymous methods arguments are not typed, but still do not have to cast them.
2) Anonymous methods can use variables defined in scope in the methods that creates the anonymous method.
3) In anonymous methods the overhead of instantiating delegates is eliminated.

on the opposite side:

You cannot have out or ref argument.

See the following link to find out more detail on anonymous methods: http://msdn.microsoft.com/en-us/library/0yw3tz5k%28v=VS.80%29.aspx[^]
 
Share this answer
 
v2
As far I know anonymous method is like a regular method with only difference that the name of the anonymous method is given by the compiler.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900