Custom validation attributes can be created by deriving from the ValidationAttribute base class, then overriding virtual methods as needed.
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public class NotABananaAttribute : ValidationAttribute
{
public ov...