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
Actually i don't have to the time to code, but an extension method with linq like this
public bool EqualsToAll(this T element, IEnumerable source)
{
if(element == null)
throw new ArgumentNullException(element);
foreach(var item in source)
{
if(!element.Equals(item)
return false;
}
return true;
}
should make it.
Warning: This code was not tested, nor written within an IDE.