using
System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Web.Script.Serialization;
using System.Reflection.Emit;
using System.Data;
using System.Reflection;
using System.Web;
using System.IO;
namespace ConsoleApplication1
... {
public delegate T lambdaFunc<T>(T t1, T t2);
public delegate TResult Func<T, TResult>(T arg);
class Program
...{
private static T DoSomeThing<T>(T t1, T t2, lambdaFunc<T> match)
...{
return match(t1, t2);
}
static void Main(string[] args)
...{
string str = "Hello!";
Console.WriteLine(DoSomeThing<int>(1, 2, (x, y) => x + y));
Console.WriteLine(str.GetValue(x => x));
Console.ReadLine();
}
}
public static class Enumerable
...{
public static T GetValue<T>(this T t1, Func<T, T> match)
...{
return match(t1);
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Web.Script.Serialization;
using System.Reflection.Emit;
using System.Data;
using System.Reflection;
using System.Web;
using System.IO;
namespace ConsoleApplication1
... {
public delegate T lambdaFunc<T>(T t1, T t2);
public delegate TResult Func<T, TResult>(T arg);
class Program
...{
private static T DoSomeThing<T>(T t1, T t2, lambdaFunc<T> match)
...{
return match(t1, t2);
}
static void Main(string[] args)
...{
string str = "Hello!";
Console.WriteLine(DoSomeThing<int>(1, 2, (x, y) => x + y));
Console.WriteLine(str.GetValue(x => x));
Console.ReadLine();
}
}
public static class Enumerable
...{
public static T GetValue<T>(this T t1, Func<T, T> match)
...{
return match(t1);
}
}
}