diff --git a/MCTG/MCTGLib/User.cs b/MCTG/MCTGLib/User.cs index f4a2f65..cc43db6 100644 --- a/MCTG/MCTGLib/User.cs +++ b/MCTG/MCTGLib/User.cs @@ -37,7 +37,7 @@ namespace MCTGLib { throw new ArgumentNullException("Erreur pour la photo d'utilisateur!"); } - + } } /// @@ -67,15 +67,27 @@ namespace MCTGLib { if (string.IsNullOrWhiteSpace(value)) { - throw new ArgumentNullException("Il y a une erreur de Prénom d'utilisateur"); + throw new ArgumentNullException("Il y a une erreur de Prénom d'utilisateur."); } surname = value; } } + /// + /// Property to get mail of users and a setter + /// + /// User's mail will serve to log the user. So there's no setter, just an init. User will enter one time his email at his + /// account creation. public string Mail { get { return mail; } - private set { mail = value; } + init + { + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentNullException("Il y a une erreur de Mail d'utilisateur."); + } + mail = value; + } } @@ -95,6 +107,9 @@ namespace MCTGLib /// /// Construtors of user. /// + /// The name of the user + /// The surname of the user + /// The user needs an email to login. public User(string name, string surname, string mail) { Name = name;