49 lines
1.1 KiB
C#
49 lines
1.1 KiB
C#
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.Contracts
|
|
{
|
|
[Table("lesson")]
|
|
public class Lesson
|
|
{
|
|
[Key]
|
|
public Guid Id { get; set; }
|
|
|
|
[StringLength(255)]
|
|
public string Title { get; set; } = string.Empty;
|
|
|
|
public string Description { get; set; } = string.Empty;
|
|
|
|
[Required]
|
|
public Guid TextbookID { get; set; }
|
|
|
|
|
|
[ForeignKey(nameof(TextbookID))]
|
|
public Textbook Textbook { get; set; }
|
|
|
|
[InverseProperty(nameof(KeyPoint.Lesson))]
|
|
public ICollection<KeyPoint>? KeyPoints { get; set; }
|
|
|
|
[InverseProperty(nameof(Question.Lesson))]
|
|
public ICollection<Question>? Questions { get; set; }
|
|
|
|
[InverseProperty(nameof(LessonQuestion.Lesson))]
|
|
public ICollection<LessonQuestion>? LessonQuestions { get; set; }
|
|
|
|
|
|
|
|
public Lesson()
|
|
{
|
|
Id = Guid.NewGuid();
|
|
KeyPoints = new HashSet<KeyPoint>();
|
|
Questions = new HashSet<Question>();
|
|
LessonQuestions = new HashSet<LessonQuestion>();
|
|
}
|
|
}
|
|
}
|