/// A user is an entity with a name, a surname, mail, profilePict and a list of priority.
/// This user can login with a Id and password
/// </summary>
publicclassUser:IEquatable<User>
{
#region Private Attributes
privatestringname="";
privatestringsurname="";
privatestringmail="";
privatestringpicture="";
namespaceModel
{
/// <summary>
/// A user is an entity with a name, a surname, mail, profilePict and a list of priority.
/// This user can login with an Id and a password
/// </summary>
publicclassUser:IEquatable<User>
{
#region Private Attributes
privatestringname="";
privatestringsurname="";
privatestringmail="";
privatestringpicture="";
privateintpassword;
privateList<Priority>priorities;
#endregion
#region Properties
/// <summary>
/// Property to get Name of users and a setter
/// </summary>
/// <exception cref="ArgumentException" >Setter have Exception which is trigger when Name is null</exception>
publicstringName
{
get{returnname;}
privateset
{
if(string.IsNullOrWhiteSpace(value))
{
thrownewArgumentException("Impossible d'avoir un champ Nom vide!");
}
name=value;
}
}
/// <summary>
/// Property to get Surname of users and a setter
/// </summary>
/// <exception cref="ArgumentException" >Setter have Exception which is trigger when Surname is null</exception>
publicstringSurname
{
get{returnsurname;}
privateset
{
if(string.IsNullOrWhiteSpace(value))
{
thrownewArgumentException("Impossible d'avoir un champ Prénom vide!");
}
surname=value;
}
}
/// <summary>
/// Property to get mail of users and a setter
/// </summary>
/// <exception cref="ArgumentException" >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.</exception>
publicstringMail
{
get{returnmail;}
privateinit
{
if(string.IsNullOrWhiteSpace(value))
{
thrownewArgumentException("Impossible d'avoir un champ Email vide!");
}
mail=value;
}
}
privateList<Priority>priorities;
#endregion
#region Properties
/// <summary>
/// Property to get Name of users and a setter
/// </summary>
/// <exception cref="ArgumentException" >Setter have Exception which is trigger when Name is null</exception>
publicstringName
{
get{returnname;}
privateset
{
if(string.IsNullOrWhiteSpace(value))
{
thrownewArgumentException("Impossible d'avoir un champ Nom vide!");
}
name=value;
}
}
/// <summary>
/// Property to get Surname of users and a setter
/// </summary>
/// <exception cref="ArgumentException" >Setter have Exception which is trigger when Surname is null</exception>
publicstringSurname
{
get{returnsurname;}
privateset
{
if(string.IsNullOrWhiteSpace(value))
{
thrownewArgumentException("Impossible d'avoir un champ Prénom vide!");
}
surname=value;
}
}
/// <summary>
/// Property to get mail of users and a setter
/// </summary>
/// <exception cref="ArgumentException" >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.</exception>
publicstringMail
{
get{returnmail;}
privateinit
{
if(string.IsNullOrWhiteSpace(value))
{
thrownewArgumentException("Impossible d'avoir un champ Email vide!");
}
mail=value;
}
}
publicintPassword
{
{
get=>password;
set=>password=value;
}
/// <summary>
/// For now, we define the ProfilPict as a string which is "PhotoParDefaut"
/// when the value is null.
/// </summary>
publicstringProfilPict
{
get=>picture;
set=>picture=value;
}
/// <summary>
/// This is the list of priorities specific tu the user. This list is initiate
/// by default. User could change it at will.
/// </summary>
publicList<Priority>Priorities
{
get=>priorities;
set=>priorities=value;
}
}
/// <summary>
/// For now, we define the ProfilPict as a string which is "PhotoParDefaut"
/// when the value is null.
/// </summary>
publicstringProfilPict
{
get=>picture;
set=>picture=value;
}
/// <summary>
/// This is the list of priorities specific tu the user. This list is initiate