I am trying to compare two structs using equals (==) in C#. My struct is below:
public struct CisSettings : IEquatable
{
public int Ga
You need to override operator == explicitly.
public static bool operator ==(CisSettings x, CisSettings y)
{
return x.Equals(y);
}
By the way, you'd better put the comparing code in public bool Equals(CisSettings other), and let bool Equals(object obj) call bool Equals(CisSettings other), so that you can gain some performance by avoiding unnecessary type check.