// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using TechHelper.Context; #nullable disable namespace TechHelper.Server.Migrations { [DbContext(typeof(ApplicationContext))] partial class ApplicationContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "8.0.16") .HasAnnotation("Proxies:ChangeTracking", false) .HasAnnotation("Proxies:CheckEquality", false) .HasAnnotation("Proxies:LazyLoading", true) .HasAnnotation("Relational:MaxIdentifierLength", 64); MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); modelBuilder.Entity("Entities.Contracts.Class", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)") .HasColumnName("class_id"); b.Property("ClassName") .IsRequired() .HasMaxLength(30) .HasColumnType("varchar(30)") .HasColumnName("class_name"); b.Property("CreatedAt") .HasColumnType("datetime(6)") .HasColumnName("created_at"); b.Property("GradeId") .HasColumnType("char(36)") .HasColumnName("grade_id"); b.Property("HeadTeacherId") .HasColumnType("char(36)") .HasColumnName("head_teacher_id"); b.Property("Index") .HasColumnType("tinyint unsigned") .HasColumnName("index"); b.Property("IsDeleted") .HasColumnType("tinyint(1)") .HasColumnName("deleted"); b.Property("UpdatedAt") .HasColumnType("datetime(6)") .HasColumnName("updated_at"); b.HasKey("Id"); b.HasIndex("GradeId"); b.HasIndex("HeadTeacherId"); b.ToTable("classes"); }); modelBuilder.Entity("Entities.Contracts.ClassUser", b => { b.Property("ClassId") .HasColumnType("char(36)") .HasColumnName("class_id") .HasColumnOrder(0); b.Property("UserId") .HasColumnType("char(36)") .HasColumnName("student_id") .HasColumnOrder(1); b.Property("EnrollmentDate") .HasColumnType("datetime(6)") .HasColumnName("enrollment_date"); b.Property("IsDeleted") .HasColumnType("tinyint(1)") .HasColumnName("deleted"); b.HasKey("ClassId", "UserId"); b.HasIndex("UserId"); b.ToTable("class_user"); }); modelBuilder.Entity("Entities.Contracts.Exam", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)") .HasColumnName("id"); b.Property("CreatedAt") .HasColumnType("datetime(6)") .HasColumnName("created_at"); b.Property("CreatorId") .HasColumnType("char(36)") .HasColumnName("created_by"); b.Property("Description") .IsRequired() .HasColumnType("longtext") .HasColumnName("description"); b.Property("DueDate") .HasColumnType("datetime(6)") .HasColumnName("due_date"); b.Property("ExamStructId") .HasColumnType("char(36)") .HasColumnName("exam_struct_id"); b.Property("ExamTypeId") .HasColumnType("char(36)") .HasColumnName("exam_type_id"); b.Property("IsDeleted") .HasColumnType("tinyint(1)") .HasColumnName("deleted"); b.Property("Name") .IsRequired() .HasColumnType("longtext") .HasColumnName("name"); b.Property("Score") .HasColumnType("float") .HasColumnName("score"); b.Property("SubjectId") .HasColumnType("char(36)") .HasColumnName("subject_id"); b.Property("Title") .IsRequired() .HasMaxLength(255) .HasColumnType("varchar(255)") .HasColumnName("title"); b.Property("TotalQuestions") .HasColumnType("tinyint unsigned") .HasColumnName("total_points"); b.Property("UpdatedAt") .HasColumnType("datetime(6)") .HasColumnName("updated_at"); b.HasKey("Id"); b.HasIndex("CreatorId"); b.HasIndex("ExamStructId") .IsUnique(); b.HasIndex("ExamTypeId"); b.HasIndex("SubjectId"); b.ToTable("exams"); }); modelBuilder.Entity("Entities.Contracts.ExamAttachment", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)") .HasColumnName("id"); b.Property("ExamId") .HasColumnType("char(36)") .HasColumnName("exam_id"); b.Property("FileName") .IsRequired() .HasMaxLength(255) .HasColumnType("varchar(255)") .HasColumnName("file_name"); b.Property("FilePath") .IsRequired() .HasMaxLength(255) .HasColumnType("varchar(255)") .HasColumnName("file_path"); b.Property("IsDeleted") .HasColumnType("tinyint(1)") .HasColumnName("deleted"); b.Property("UploadedAt") .HasColumnType("datetime(6)") .HasColumnName("uploaded_at"); b.HasKey("Id"); b.HasIndex("ExamId"); b.ToTable("exam_attachments"); }); modelBuilder.Entity("Entities.Contracts.ExamQuestion", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)") .HasColumnName("id"); b.Property("CreatedAt") .HasColumnType("datetime(6)") .HasColumnName("created_at"); b.Property("ExamStructType") .HasColumnType("tinyint unsigned") .HasColumnName("exam_struct_type"); b.Property("Index") .HasColumnType("tinyint unsigned") .HasColumnName("question_number"); b.Property("IsDeleted") .HasColumnType("tinyint(1)") .HasColumnName("deleted"); b.Property("ParentExamQuestionId") .HasColumnType("char(36)") .HasColumnName("parent_question_group_id"); b.Property("QuestionContextId") .HasColumnType("char(36)") .HasColumnName("description"); b.Property("QuestionId") .HasColumnType("char(36)") .HasColumnName("question_id"); b.Property("QuestionTypeId") .HasColumnType("char(36)"); b.Property("Score") .HasColumnType("float") .HasColumnName("score"); b.Property("Sequence") .IsRequired() .HasColumnType("longtext") .HasColumnName("sequence"); b.Property("Title") .HasMaxLength(1024) .HasColumnType("varchar(1024)") .HasColumnName("title"); b.HasKey("Id"); b.HasIndex("ParentExamQuestionId"); b.HasIndex("QuestionContextId"); b.HasIndex("QuestionId"); b.HasIndex("QuestionTypeId"); b.ToTable("exam_questions"); }); modelBuilder.Entity("Entities.Contracts.ExamType", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)") .HasColumnName("id"); b.Property("Description") .IsRequired() .HasColumnType("longtext") .HasColumnName("description"); b.Property("Name") .IsRequired() .HasMaxLength(20) .HasColumnType("varchar(20)") .HasColumnName("name"); b.HasKey("Id"); b.ToTable("exam_type"); }); modelBuilder.Entity("Entities.Contracts.Grade", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)") .HasColumnName("grade_id"); b.Property("GradeLevel") .HasColumnType("tinyint unsigned") .HasColumnName("grade_level"); b.Property("GradeName") .IsRequired() .HasMaxLength(20) .HasColumnType("varchar(20)") .HasColumnName("grade_name"); b.Property("SchoolId") .HasColumnType("char(36)") .HasColumnName("school_id"); b.HasKey("Id"); b.HasIndex("SchoolId"); b.ToTable("grades"); }); modelBuilder.Entity("Entities.Contracts.KeyPoint", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Key") .IsRequired() .HasMaxLength(255) .HasColumnType("varchar(255)"); b.Property("LessonID") .HasColumnType("char(36)"); b.HasKey("Id"); b.HasIndex("LessonID"); b.ToTable("key_point"); }); modelBuilder.Entity("Entities.Contracts.Lesson", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Description") .IsRequired() .HasColumnType("longtext"); b.Property("TextbookID") .HasColumnType("char(36)"); b.Property("Title") .IsRequired() .HasMaxLength(255) .HasColumnType("varchar(255)"); b.HasKey("Id"); b.HasIndex("TextbookID"); b.ToTable("lesson"); }); modelBuilder.Entity("Entities.Contracts.LessonQuestion", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("LessonID") .HasColumnType("char(36)"); b.Property("Question") .IsRequired() .HasMaxLength(65535) .HasColumnType("longtext"); b.HasKey("Id"); b.HasIndex("LessonID"); b.ToTable("lesson_question"); }); modelBuilder.Entity("Entities.Contracts.Question", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)") .HasColumnName("id"); b.Property("Answer") .HasMaxLength(65535) .HasColumnType("longtext") .HasColumnName("answer"); b.Property("CreatedAt") .HasColumnType("datetime(6)") .HasColumnName("created_at"); b.Property("IsDeleted") .HasColumnType("tinyint(1)") .HasColumnName("deleted"); b.Property("KeyPointId") .HasColumnType("char(36)") .HasColumnName("key_point"); b.Property("LessonId") .HasColumnType("char(36)") .HasColumnName("lesson"); b.Property("Options") .HasColumnType("longtext") .HasColumnName("options"); b.Property("QuestioTypeId") .HasColumnType("char(36)") .HasColumnName("type"); b.Property("SubjectId") .HasColumnType("char(36)") .HasColumnName("subject_area"); b.Property("Title") .IsRequired() .HasMaxLength(65535) .HasColumnType("longtext") .HasColumnName("title"); b.Property("UpdatedAt") .HasColumnType("datetime(6)") .HasColumnName("updated_at"); b.HasKey("Id"); b.HasIndex("KeyPointId"); b.HasIndex("LessonId"); b.HasIndex("QuestioTypeId"); b.HasIndex("SubjectId"); b.ToTable("questions"); }); modelBuilder.Entity("Entities.Contracts.QuestionContext", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Description") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.ToTable("QuestionContexts"); }); modelBuilder.Entity("Entities.Contracts.QuestionType", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)") .HasColumnName("id"); b.Property("Description") .IsRequired() .HasColumnType("longtext") .HasColumnName("description"); b.Property("Name") .IsRequired() .HasMaxLength(20) .HasColumnType("varchar(20)") .HasColumnName("name"); b.Property("ScoreRule") .IsRequired() .HasMaxLength(20) .HasColumnType("varchar(20)") .HasColumnName("score_rule"); b.Property("SubjectId") .HasColumnType("char(36)") .HasColumnName("subject_id"); b.HasKey("Id"); b.HasIndex("SubjectId"); b.ToTable("question_types"); }); modelBuilder.Entity("Entities.Contracts.School", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)") .HasColumnName("id"); b.Property("Address") .IsRequired() .HasMaxLength(100) .HasColumnType("varchar(100)") .HasColumnName("address"); b.Property("CreateTime") .HasColumnType("datetime(6)") .HasColumnName("create_time"); b.Property("SchoolName") .IsRequired() .HasMaxLength(50) .HasColumnType("varchar(50)") .HasColumnName("school_name"); b.HasKey("Id"); b.ToTable("schools"); }); modelBuilder.Entity("Entities.Contracts.Subject", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)") .HasColumnName("id"); b.Property("Description") .IsRequired() .HasColumnType("longtext") .HasColumnName("description"); b.Property("Name") .IsRequired() .HasMaxLength(20) .HasColumnType("varchar(20)") .HasColumnName("name"); b.HasKey("Id"); b.ToTable("subjects"); }); modelBuilder.Entity("Entities.Contracts.Submission", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)") .HasColumnName("id"); b.Property("AttemptNumber") .HasColumnType("tinyint unsigned") .HasColumnName("attempt_number"); b.Property("ClassId") .HasColumnType("char(36)") .HasColumnName("class_id"); b.Property("ErrorQuesNum") .HasColumnType("tinyint unsigned"); b.Property("ExamId") .HasColumnType("char(36)") .HasColumnName("exam_id"); b.Property("GradedAt") .HasColumnType("datetime(6)") .HasColumnName("graded_at"); b.Property("GraderId") .HasColumnType("char(36)") .HasColumnName("graded_by"); b.Property("IsDeleted") .HasColumnType("tinyint(1)") .HasColumnName("deleted"); b.Property("OverallFeedback") .HasColumnType("longtext") .HasColumnName("overall_feedback"); b.Property("OverallGrade") .HasColumnType("float") .HasColumnName("overall_grade"); b.Property("Status") .HasColumnType("int") .HasColumnName("status"); b.Property("StudentId") .HasColumnType("char(36)") .HasColumnName("student_id"); b.Property("SubmissionTime") .HasColumnType("datetime(6)") .HasColumnName("submission_time"); b.Property("TotalQuesNum") .HasColumnType("tinyint unsigned"); b.Property("TotalScore") .HasColumnType("float"); b.HasKey("Id"); b.HasIndex("ClassId"); b.HasIndex("ExamId"); b.HasIndex("GraderId"); b.HasIndex("StudentId"); b.ToTable("submissions"); }); modelBuilder.Entity("Entities.Contracts.SubmissionDetail", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)") .HasColumnName("id"); b.Property("CreatedAt") .HasColumnType("datetime(6)") .HasColumnName("created_at"); b.Property("ExamQuestionId") .HasColumnType("char(36)") .HasColumnName("exam_question_id"); b.Property("IsCorrect") .HasColumnType("tinyint(1)") .HasColumnName("is_correct"); b.Property("IsDeleted") .HasColumnType("tinyint(1)") .HasColumnName("deleted"); b.Property("PointsAwarded") .HasColumnType("float") .HasColumnName("points_awarded"); b.Property("StudentAnswer") .HasColumnType("longtext") .HasColumnName("student_answer"); b.Property("StudentId") .HasColumnType("char(36)") .HasColumnName("student_id"); b.Property("SubmissionId") .HasColumnType("char(36)") .HasColumnName("submission_id"); b.Property("TeacherFeedback") .HasColumnType("longtext") .HasColumnName("teacher_feedback"); b.Property("UpdatedAt") .HasColumnType("datetime(6)") .HasColumnName("updated_at"); b.HasKey("Id"); b.HasIndex("ExamQuestionId"); b.HasIndex("StudentId"); b.HasIndex("SubmissionId"); b.ToTable("submission_details"); }); modelBuilder.Entity("Entities.Contracts.Textbook", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Grade") .HasColumnType("tinyint unsigned"); b.Property("Publisher") .HasColumnType("tinyint unsigned"); b.Property("SubjectArea") .HasColumnType("tinyint unsigned"); b.Property("Title") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.ToTable("textbook"); }); modelBuilder.Entity("Entities.Contracts.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("AccessFailedCount") .HasColumnType("int"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("longtext"); b.Property("DisplayName") .HasColumnType("longtext"); b.Property("Email") .HasMaxLength(256) .HasColumnType("varchar(256)"); b.Property("EmailConfirmed") .HasColumnType("tinyint(1)"); b.Property("HomeAddress") .HasColumnType("longtext"); b.Property("IsDeleted") .HasColumnType("tinyint(1)") .HasColumnName("deleted"); b.Property("LockoutEnabled") .HasColumnType("tinyint(1)"); b.Property("LockoutEnd") .HasColumnType("datetime(6)"); b.Property("NormalizedEmail") .HasMaxLength(256) .HasColumnType("varchar(256)"); b.Property("NormalizedUserName") .HasMaxLength(256) .HasColumnType("varchar(256)"); b.Property("PasswordHash") .HasColumnType("longtext"); b.Property("PhoneNumber") .HasColumnType("longtext"); b.Property("PhoneNumberConfirmed") .HasColumnType("tinyint(1)"); b.Property("RefreshToken") .HasColumnType("longtext"); b.Property("RefreshTokenExpiryTime") .HasColumnType("datetime(6)"); b.Property("Role") .HasColumnType("int"); b.Property("SecurityStamp") .HasColumnType("longtext"); b.Property("TeachSubjectId") .HasColumnType("char(36)"); b.Property("TwoFactorEnabled") .HasColumnType("tinyint(1)"); b.Property("UserName") .HasMaxLength(256) .HasColumnType("varchar(256)"); b.HasKey("Id"); b.HasIndex("NormalizedEmail") .HasDatabaseName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() .HasDatabaseName("UserNameIndex"); b.HasIndex("TeachSubjectId"); b.ToTable("AspNetUsers", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("longtext"); b.Property("Name") .HasMaxLength(256) .HasColumnType("varchar(256)"); b.Property("NormalizedName") .HasMaxLength(256) .HasColumnType("varchar(256)"); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() .HasDatabaseName("RoleNameIndex"); b.ToTable("AspNetRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("ClaimType") .HasColumnType("longtext"); b.Property("ClaimValue") .HasColumnType("longtext"); b.Property("RoleId") .HasColumnType("char(36)"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AspNetRoleClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("ClaimType") .HasColumnType("longtext"); b.Property("ClaimValue") .HasColumnType("longtext"); b.Property("UserId") .HasColumnType("char(36)"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AspNetUserClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.Property("LoginProvider") .HasColumnType("varchar(255)"); b.Property("ProviderKey") .HasColumnType("varchar(255)"); b.Property("ProviderDisplayName") .HasColumnType("longtext"); b.Property("UserId") .HasColumnType("char(36)"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("AspNetUserLogins", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.Property("UserId") .HasColumnType("char(36)"); b.Property("RoleId") .HasColumnType("char(36)"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.ToTable("AspNetUserRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") .HasColumnType("char(36)"); b.Property("LoginProvider") .HasColumnType("varchar(255)"); b.Property("Name") .HasColumnType("varchar(255)"); b.Property("Value") .HasColumnType("longtext"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AspNetUserTokens", (string)null); }); modelBuilder.Entity("Entities.Contracts.Class", b => { b.HasOne("Entities.Contracts.Grade", "Grade") .WithMany("Classes") .HasForeignKey("GradeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Entities.Contracts.User", "HeadTeacher") .WithMany() .HasForeignKey("HeadTeacherId"); b.Navigation("Grade"); b.Navigation("HeadTeacher"); }); modelBuilder.Entity("Entities.Contracts.ClassUser", b => { b.HasOne("Entities.Contracts.Class", "Class") .WithMany("ClassUsers") .HasForeignKey("ClassId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Entities.Contracts.User", "User") .WithMany("UserInjoinedClass") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Class"); b.Navigation("User"); }); modelBuilder.Entity("Entities.Contracts.Exam", b => { b.HasOne("Entities.Contracts.User", "Creator") .WithMany("CreatedExams") .HasForeignKey("CreatorId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Entities.Contracts.ExamQuestion", "ExamStruct") .WithOne("Exam") .HasForeignKey("Entities.Contracts.Exam", "ExamStructId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Entities.Contracts.ExamType", "ExamType") .WithMany("Exams") .HasForeignKey("ExamTypeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Entities.Contracts.Subject", "Subject") .WithMany() .HasForeignKey("SubjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Creator"); b.Navigation("ExamStruct"); b.Navigation("ExamType"); b.Navigation("Subject"); }); modelBuilder.Entity("Entities.Contracts.ExamAttachment", b => { b.HasOne("Entities.Contracts.Exam", "Exam") .WithMany("ExamAttachments") .HasForeignKey("ExamId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Exam"); }); modelBuilder.Entity("Entities.Contracts.ExamQuestion", b => { b.HasOne("Entities.Contracts.ExamQuestion", "ParentExamQuestion") .WithMany("ChildExamQuestions") .HasForeignKey("ParentExamQuestionId"); b.HasOne("Entities.Contracts.QuestionContext", "QuestionContext") .WithMany("Questions") .HasForeignKey("QuestionContextId"); b.HasOne("Entities.Contracts.Question", "Question") .WithMany("ExamQuestions") .HasForeignKey("QuestionId"); b.HasOne("Entities.Contracts.QuestionType", "Type") .WithMany() .HasForeignKey("QuestionTypeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("ParentExamQuestion"); b.Navigation("Question"); b.Navigation("QuestionContext"); b.Navigation("Type"); }); modelBuilder.Entity("Entities.Contracts.Grade", b => { b.HasOne("Entities.Contracts.School", "School") .WithMany("Grades") .HasForeignKey("SchoolId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("School"); }); modelBuilder.Entity("Entities.Contracts.KeyPoint", b => { b.HasOne("Entities.Contracts.Lesson", "Lesson") .WithMany("KeyPoints") .HasForeignKey("LessonID") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Lesson"); }); modelBuilder.Entity("Entities.Contracts.Lesson", b => { b.HasOne("Entities.Contracts.Textbook", "Textbook") .WithMany("Lessons") .HasForeignKey("TextbookID") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Textbook"); }); modelBuilder.Entity("Entities.Contracts.LessonQuestion", b => { b.HasOne("Entities.Contracts.Lesson", "Lesson") .WithMany("LessonQuestions") .HasForeignKey("LessonID") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Lesson"); }); modelBuilder.Entity("Entities.Contracts.Question", b => { b.HasOne("Entities.Contracts.KeyPoint", "KeyPoint") .WithMany("Questions") .HasForeignKey("KeyPointId"); b.HasOne("Entities.Contracts.Lesson", "Lesson") .WithMany("Questions") .HasForeignKey("LessonId"); b.HasOne("Entities.Contracts.QuestionType", "QuestionType") .WithMany("Questions") .HasForeignKey("QuestioTypeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Entities.Contracts.Subject", "Subject") .WithMany("Questions") .HasForeignKey("SubjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("KeyPoint"); b.Navigation("Lesson"); b.Navigation("QuestionType"); b.Navigation("Subject"); }); modelBuilder.Entity("Entities.Contracts.QuestionType", b => { b.HasOne("Entities.Contracts.Subject", "Subject") .WithMany("QuestionTypes") .HasForeignKey("SubjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Subject"); }); modelBuilder.Entity("Entities.Contracts.Submission", b => { b.HasOne("Entities.Contracts.Class", "Class") .WithMany() .HasForeignKey("ClassId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Entities.Contracts.Exam", "Exam") .WithMany("Submissions") .HasForeignKey("ExamId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Entities.Contracts.User", "Grader") .WithMany("GradedSubmissions") .HasForeignKey("GraderId"); b.HasOne("Entities.Contracts.User", "Student") .WithMany("StudentSubmissions") .HasForeignKey("StudentId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Class"); b.Navigation("Exam"); b.Navigation("Grader"); b.Navigation("Student"); }); modelBuilder.Entity("Entities.Contracts.SubmissionDetail", b => { b.HasOne("Entities.Contracts.ExamQuestion", "ExamQuestion") .WithMany("SubmissionDetails") .HasForeignKey("ExamQuestionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Entities.Contracts.User", "Student") .WithMany("SubmissionDetails") .HasForeignKey("StudentId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Entities.Contracts.Submission", "Submission") .WithMany("SubmissionDetails") .HasForeignKey("SubmissionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("ExamQuestion"); b.Navigation("Student"); b.Navigation("Submission"); }); modelBuilder.Entity("Entities.Contracts.User", b => { b.HasOne("Entities.Contracts.Subject", "TeachSubject") .WithMany("SubjectTeachers") .HasForeignKey("TeachSubjectId"); b.Navigation("TeachSubject"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.HasOne("Entities.Contracts.User", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.HasOne("Entities.Contracts.User", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Entities.Contracts.User", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.HasOne("Entities.Contracts.User", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Entities.Contracts.Class", b => { b.Navigation("ClassUsers"); }); modelBuilder.Entity("Entities.Contracts.Exam", b => { b.Navigation("ExamAttachments"); b.Navigation("Submissions"); }); modelBuilder.Entity("Entities.Contracts.ExamQuestion", b => { b.Navigation("ChildExamQuestions"); b.Navigation("Exam"); b.Navigation("SubmissionDetails"); }); modelBuilder.Entity("Entities.Contracts.ExamType", b => { b.Navigation("Exams"); }); modelBuilder.Entity("Entities.Contracts.Grade", b => { b.Navigation("Classes"); }); modelBuilder.Entity("Entities.Contracts.KeyPoint", b => { b.Navigation("Questions"); }); modelBuilder.Entity("Entities.Contracts.Lesson", b => { b.Navigation("KeyPoints"); b.Navigation("LessonQuestions"); b.Navigation("Questions"); }); modelBuilder.Entity("Entities.Contracts.Question", b => { b.Navigation("ExamQuestions"); }); modelBuilder.Entity("Entities.Contracts.QuestionContext", b => { b.Navigation("Questions"); }); modelBuilder.Entity("Entities.Contracts.QuestionType", b => { b.Navigation("Questions"); }); modelBuilder.Entity("Entities.Contracts.School", b => { b.Navigation("Grades"); }); modelBuilder.Entity("Entities.Contracts.Subject", b => { b.Navigation("QuestionTypes"); b.Navigation("Questions"); b.Navigation("SubjectTeachers"); }); modelBuilder.Entity("Entities.Contracts.Submission", b => { b.Navigation("SubmissionDetails"); }); modelBuilder.Entity("Entities.Contracts.Textbook", b => { b.Navigation("Lessons"); }); modelBuilder.Entity("Entities.Contracts.User", b => { b.Navigation("CreatedExams"); b.Navigation("GradedSubmissions"); b.Navigation("StudentSubmissions"); b.Navigation("SubmissionDetails"); b.Navigation("UserInjoinedClass"); }); #pragma warning restore 612, 618 } } }