while trying to compile following code
IEquatable<Object> value = "test";
it causes this error:
Cannot implicitly convert type 'string' to 'System.IEquatable<object>'
but string implements IEquatable<String>
MyCode:
public class Equals : Validation
{
public IEquatable<Object> Value { get; set; }
public Equals(IEquatable<Object> value)
{
Value = value;
}
public override bool Validate(Object value)
{
return Value.Equals(value);
}
}
Usage
[Equals("test")]
public string Name { get; set; }