Action a = () => Debug.Log(true);
Action b = () => Debug.Log(true);
var result = AreEqual(a, b);
public bool AreEqual<T>(T template, object action)
{
}
var result = AreEqual(()=> Debug.Log(true), b);
using System;
using System.Diagnostics;
using System.Linq.Expressions;
using Db4objects.Db4o.Linq.Expressions;
class Test
{
static void Main()
{
Expression<Action> a = () => Debug.Write(1);
Expression<Action> b = () => Debug.Write(1);
Expression<Action> c = () => Debug.Write(2);
Expression<Action> d = () => a.Compile();
Func<Expression, Expression, bool> eq =
ExpressionEqualityComparer.Instance.Equals;
Console.WriteLine(eq(a, b)); //true
Console.WriteLine(eq(a, c)); //false
Console.WriteLine(eq(a, d)); //false
Console.WriteLine(eq(a, (Expression<Action>)(() => Debug.Write(1)))); //true
Console.ReadKey();
}
}