ValidationAttribute question

Can custom validation attributes be applied at the entity class level? Such that I can do something like this:

[SampleValidator]
public class Sample
{
public int Id { get; set; }
public string Name { get; set; }
}

public class SampleValidator : ValidationAttribute
{
public SampleValidator() : base()
{
ErrorMessageResourceType = typeof(Resources.Locale);
}
public override bool IsValid(object value)
{
Sample candidate = (Sample)value;
if (candidate.Id < 0)
{
ErrorMessageResourceName = “sample_id_is_invalid”;
return false;
}
if (candidate.Name == string.Empty)
{
ErrorMessageResourceName = “sample_name_is_required”;
return false;
}
}
}

This way, I can expose one error at a time, rather than a list.