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