using System.Collections.Generic;
public static void Main()
const bool useStringToStringIgnoreCase = false;
Func<object, object, Tuple<object, object>> t = (x, y) => new Tuple<object, object>(x, y);
Func<int, int, DateTime> dt = (m, d) => new DateTime(2016, m, d);
Func<int, int, DateTime?> ndt = (m, d) => (DateTime?)(new DateTime(2016, m, d));
string a3 = string.Empty;
var tups = new List<Tuple<object, object>>
t("3/17/2016 12:00:00 AM", dt(3,17)),
HasDiff(tup.Item1, tup.Item2, useStringToStringIgnoreCase);
private static bool HasDiff(object o, object value, bool useStringToStringIgnoreCase = false)
var message = string.Format("[{0}] and [{1}]", o, value);
var types = string.Format("{0} vs {1}", TypeMe(o), TypeMe(value));
Func<bool, bool> yo = b => {
Console.WriteLine("{0} comp indicates {1} are {2} ({3})", comp, message, (b ? "NOT equal" : "equal"), types);
if (useStringToStringIgnoreCase && o is string && value is string)
if (!((string)o).Equals((string)value, StringComparison.InvariantCultureIgnoreCase))
else if (o is string || value is string)
if (!Object.Equals((o ?? ""), (value ?? "")))
else if (!Object.Equals(value, o))
private static Type TypeMe(object o)
catch (NullReferenceException)