using System;
namespace Articulos.Cap04
{
public sealed class DelegadoExpresionLambda
{
public static void Main()
{
// declaración de delegado genérico:
Func<int, int, int> suma;
// asignación de una expresión lambda:
suma = (int a, int b) => a + b;
Console.WriteLine ("La suma de 5 más 3 es igual a {0}", suma(7, 4).ToString());
}
}
}
dXNpbmcgU3lzdGVtOwoKbmFtZXNwYWNlIEFydGljdWxvcy5DYXAwNAp7CiAgICBwdWJsaWMgc2VhbGVkIGNsYXNzIERlbGVnYWRvRXhwcmVzaW9uTGFtYmRhCiAgICB7CiAgICAgICAgcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKQogICAgICAgIHsKICAgICAgICAgICAgLy8gZGVjbGFyYWNpw7NuIGRlIGRlbGVnYWRvIGdlbsOpcmljbzoKICAgICAgICAgICAgRnVuYzxpbnQsIGludCwgaW50PiBzdW1hOwogICAgICAgICAgICAKICAgICAgICAgICAgLy8gYXNpZ25hY2nDs24gZGUgdW5hIGV4cHJlc2nDs24gbGFtYmRhOgogICAgICAgICAgICBzdW1hID0gKGludCBhLCBpbnQgYikgPT4gYSArIGI7CiAgICAgICAgICAgIAogICAgICAgICAgICBDb25zb2xlLldyaXRlTGluZSAoIkxhIHN1bWEgZGUgNSBtw6FzIDMgZXMgaWd1YWwgYSB7MH0iLCBzdW1hKDcsIDQpLlRvU3RyaW5nKCkpOwogICAgICAgIH0KICAgIH0gICAgCn0=