using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DAL { [MetadataType(typeof( Personne.PersonneMetadata ))] partial class Personne { private class PersonneMetadata { [Display(Name = "Identifiant")] public object Id; [Display( Name = "Civilité !" )] [Required( ErrorMessage = "{0} est obligatware !")] public object TitreId; [Required( ErrorMessage = "{0} est obligatware !")] [MaxLength( 50, ErrorMessage = "50 caractères maxi pour {0}" )] public string Nom { get; set; } [Display( Name = "Prénom" )] [Required( ErrorMessage = "{0} est obligatware !")] [MaxLength( 50, ErrorMessage = "50 caractères maxi pour {0}" )] public string Prenom { get; set; } [Display( Name = "Téléphone" )] [Required( ErrorMessage = "{0} est obligatware !")] [RegularExpression( "^0[1-9][0-9]{8}$", ErrorMessage = "C'est pas un téléphone, ça !" )] public string Telephone { get; set; } } } }