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.
30 lines
884 B
30 lines
884 B
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Entities
|
|
{
|
|
/// <summary>
|
|
/// define an entity for an answer for a Question with Mutiple Choice
|
|
/// properties :
|
|
/// Id : identifier in the database
|
|
/// Content : content of the answer
|
|
/// IdQuestion : the id of the question which it answer to
|
|
/// Question : the question which it answer to
|
|
/// </summary>
|
|
[Table("Answer")]
|
|
public class AnswerEntity
|
|
{
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
public int Id { get; set; }
|
|
|
|
[Required]
|
|
public string Content { get; set; } = null!;
|
|
|
|
[ForeignKey(nameof(Question))]
|
|
public int? IdQuestion { get; set; }
|
|
|
|
public QuestionEntity? Question { get; set; }
|
|
}
|
|
}
|