我上课了:
public class MultilanguageClass{
public string En { get; set; }
public string De { get; set; }
}
现在我要创建类:
public class MyShortText{
[MaxLength(40, ErrorMessage = "Name cannot be longer than 40 characters.")]
public MultilanguageClass Name { get; set; }
}
public class MyLongText{
[MaxLength(140, ErrorMessage = "Name cannot be longer than 40 characters.")]
public MultilanguageClass Name { get; set; }
}
现在我想,这个40个字符对于我的MyShortText类中的En和De是实际的,对于MyLongText类是140。如何实现这个?