添加学校表和年级表,修改班级表结构

This commit is contained in:
SpecialX
2025-09-12 14:32:14 +08:00
parent 0d19ec6bb6
commit 403b34a098
3 changed files with 80 additions and 16 deletions

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Entities.Contracts
{
[Table("grades")]
public class Grade
{
[Key]
[Column("grade_id")]
public int GradeId { get; set; }
[Column("school_id")]
public int SchoolId { get; set; }
public School School { get; set; }
[Column("grade_name")]
[MaxLength(20)]
public string GradeName { get; set; }
[Column("grade_level")]
public int GradeLevel { get; set; }
// Navigation Properties
public ICollection<Class> Classes { get; set; }
public Grade()
{
Classes = new HashSet<Class>();
}
}
}