namespace Model
{
///
/// define an answer for a Question with Mutiple Choice
/// variable :
/// id : identifier in the database
/// content : content of the answer
///
public class Answer
{
private long id;
private string? content;
///
/// property for id manipulations
///
public long Id
{
get
{
return id;
}
private set
{
id = value < -1 ? -1 : value;
}
}
///
/// property for content manipulations
///
public string Content
{
get
{
return content == null ? "" : content;
}
set
{
content = value == "" ? null : value;
}
}
///
/// constructor of an answer
///
/// the content of an answer
/// the id of an answer
private Answer(string content, long id = -1)
{
Id = id;
Content = content;
}
}
}