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

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,35 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Entities.Contracts
{
[Table("schools")]
public class School
{
[Key]
[Column("school_id")]
public int SchoolId { get; set; }
[Column("school_name")]
[MaxLength(50)]
public string SchoolName { get; set; }
[Column("address")]
[MaxLength(100)]
public string Address { get; set; }
[Column("create_time")]
public DateTime CreateTime { get; set; }
// Navigation Properties
public ICollection<Grade> Grades { get; set; }
public School()
{
Grades = new HashSet<Grade>();
CreateTime = DateTime.Now;
}
}
}