You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.2 KiB
39 lines
1.2 KiB
namespace Entities
|
|
{
|
|
public class AnswerEntity
|
|
{
|
|
/// <summary>
|
|
/// define an entity of an answer for a Question with Mutiple Choice
|
|
/// properties :
|
|
/// Id : identifier in the database
|
|
/// Content : content of the answer
|
|
/// </summary>
|
|
public long Id { get; set; }
|
|
public string Content { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// equality protocole
|
|
/// </summary>
|
|
/// <param name="obj">an object</param>
|
|
/// <returns>
|
|
/// true if the object is an AnswerEntity
|
|
/// and the two contents are equals
|
|
/// (we don't care about the id because
|
|
/// he's set by the database
|
|
/// </returns>
|
|
public override bool Equals(object? obj)
|
|
{
|
|
return obj != null && obj is AnswerEntity other
|
|
&& other.Content == Content;
|
|
}
|
|
/// <summary>
|
|
/// GetHashCode method
|
|
/// </summary>
|
|
/// <returns>base.GetHashCode</returns>
|
|
public override int GetHashCode()
|
|
{
|
|
return base.GetHashCode();
|
|
}
|
|
}
|
|
}
|