添加学校表和年级表,修改班级表结构
This commit is contained in:
35
Entities/Contracts/School.cs
Normal file
35
Entities/Contracts/School.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user