ServerSide Validation through validation object

This commit is contained in:
2019-01-23 21:43:27 +01:00
parent ecadd21228
commit 3e501b29d0
7 changed files with 58 additions and 7 deletions

View File

@ -10,11 +10,12 @@ namespace Vidly.Models
{
public int Id { get; set; }
[Required]
[Required(ErrorMessage ="Please enter customer's name.")]
[StringLength(255)]
public string Name { get; set; }
[Display(Name = "Date of Birth")]
[Min18YearsIfAMember]
public DateTime? BirthDate { get; set; }
public bool IsSubscribedToNewsLetter { get; set; }