I\'ve a situation where I need to check whether multiple variables are having same data such as
var x=1; var y=1; var z=1;
I want to check
Add this extension:
public static class Extensions { public static bool EqualsAll(this T subject, params T[] values) => values == null || values.Length == 0 || values.All(v => v.Equals(subject)); }
Then call it like so:
if(1.EqualsAll(x, y, z))