Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From <a href="http://msdn.microsoft.com/en-us/library/0yw3tz5k.aspx" rel="nofollow noreferrer">MSDN</a>,</p> <blockquote> <p>In versions of C# before 2.0, the only way to declare a delegate was to use named methods. C# 2.0 introduced anonymous methods and in C# 3.0 and later, lambda expressions supersede anonymous methods as the preferred way to write inline code.</p> </blockquote> <p>and</p> <blockquote> <p>There is one case in which an anonymous method provides functionality not found in lambda expressions. Anonymous methods enable you to omit the parameter list. This means that an anonymous method can be converted to delegates with a variety of signatures.</p> </blockquote> <p>You may also be interested in this SO answer on <a href="https://stackoverflow.com/questions/299703/c-delegate-keyword-vs-lambda-notation/299712#299712">delegate keyword vs lambda expression</a>.</p> <p>Additionally, MSDN has a <a href="http://msdn.microsoft.com/en-us/library/bb397687.aspx" rel="nofollow noreferrer">good article on Lambda Expressions</a>:</p> <pre><code>delegate int del(int i); static void Main(string[] args) { del myDelegate = x =&gt; x * x; int j = myDelegate(5); //j = 25 } </code></pre> <blockquote> <p>In the previous example, notice that the delegate signature has one implicitly-typed input parameter of type int, and returns an int. The lambda expression can be converted to a delegate of that type because it also has one input parameter (x) and a return value that the compiler can implicitly convert to type int. (Type inference is discussed in more detail in the following sections.) When the delegate is invoked by using an input parameter of 5, it returns a result of 25.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload