| CannotApplyEqualityOperatorAttribute Class |
Indicates that the value of the marked type (or its derivatives)
cannot be compared using '==' or '!=' operators and Equals()
should be used instead. However, using '==' or '!=' for comparison
with null is always permitted.
Inheritance Hierarchy
Namespace: Hangfire.AnnotationsAssembly: Hangfire.Core (in Hangfire.Core.dll) Version: 1.5.0.0
Syntax [AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Interface, AllowMultiple = false,
Inherited = true)]
public sealed class CannotApplyEqualityOperatorAttribute : Attribute
<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Struct Or AttributeTargets.Interface, AllowMultiple := false,
Inherited := true)>
Public NotInheritable Class CannotApplyEqualityOperatorAttribute
Inherits Attribute
The CannotApplyEqualityOperatorAttribute type exposes the following members.
Constructors Examples [CannotApplyEqualityOperator]
class NoEquality { }
class UsesNoEquality
{
public void Test()
{
var ca1 = new NoEquality();
var ca2 = new NoEquality();
if (ca1 != null)
{
bool condition = ca1 == ca2;
}
}
}
See Also