未在PersonaFisica中执行验证
..
块引用
[MetadataType(typeof(IValidationPersona))]
public class Persona : Entidad, IValidationPersona
{
public string Mail { get; set; }
public string Telefono { get; set; }
}
[MetadataType(typeof(IValidationPersonaFisica))]
public class PersonaFisica : Persona, IValidationPersonaFisica
{
public string Nombre { get; set; }
public string Apellido { get; set; }
}
public interface IValidationPersona
{
[DisplayName("Persona -- Email")]
string Mail { get; set; }
[RegularExpression(@"^\d+$", ErrorMessageResourceType = typeof(ValidationMessages), ErrorMessageResourceName = "SoloNumeros")]
string Telefono { get; set; }
}
public interface IValidationPersona
{
[DisplayName("Persona -- Email")]
string Mail { get; set; }
[RegularExpression(@"^\d+$", ErrorMessageResourceType = typeof(ValidationMessages), ErrorMessageResourceName = "SoloNumeros")]
string Telefono { get; set; }
}
验证不适用于接口中的继承,谢谢!