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.
44 lines
1.5 KiB
44 lines
1.5 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Entities
|
|
{
|
|
[Table("Questions")]
|
|
public class QuestionEntity
|
|
{
|
|
/// <summary>
|
|
/// represent a mathematical question
|
|
/// properties :
|
|
/// Id : identifier of the question in the database
|
|
/// Content : the content of the question
|
|
/// Difficulty : difficulty (between 1 and 3 included) of the question
|
|
/// NbFails : number of time that people fail on this question
|
|
/// IdChapter : identifier of the chapter of the question
|
|
/// IdAnswerGood : identifier of the right answer to this question
|
|
/// Chapter : the chapter of the question
|
|
/// AnswerGood : the right answer to this question
|
|
/// </summary>
|
|
[Key]
|
|
public uint? Id { get; set; }
|
|
public string Content { get; set; } = null!;
|
|
[AllowedValues(1, 2, 3)]
|
|
public byte Difficulty { get; set; }
|
|
public uint NbFalls { get; set; }
|
|
|
|
[ForeignKey(nameof(Chapter))]
|
|
public uint? IdChapter { get; set; }
|
|
|
|
[ForeignKey(nameof(AnswerGood))]
|
|
public uint? IdAnswerGood { get; set; }
|
|
|
|
public ChapterEntity? Chapter { get; set; }
|
|
|
|
public AnswerEntity? AnswerGood { get; set; }
|
|
}
|
|
}
|