123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using Furion.DatabaseAccessor;
- using Microsoft.EntityFrameworkCore;
- using Microsoft.EntityFrameworkCore.Metadata.Builders;
- using System;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- namespace YBEE.EQM.Core;
- /// <summary>
- /// 监测年级
- /// </summary>
- [Comment("监测年级")]
- public class ExamGrade : DEntityBase, IEntityTypeBuilder<ExamGrade>
- {
- /// <summary>
- /// 监测计划ID
- /// </summary>
- [Comment("监测计划ID")]
- [Required]
- public int ExamPlanId { get; set; }
- /// <summary>
- /// 年级ID
- /// </summary>
- [Comment("年级ID")]
- [Required]
- public short GradeId { get; set; }
- /// <summary>
- /// 年份(级)
- /// </summary>
- [Comment("年份(级)")]
- [Required]
- public short GradeBeginYear { get; set; }
- /// <summary>
- /// 年份(届)
- /// </summary>
- [Comment("年份(届)")]
- [Required]
- public short GradeEndYear { get; set; }
- /// <summary>
- /// 学段
- /// </summary>
- [Comment("学段")]
- [Required, Column(TypeName = "smallint")]
- public EducationStage EducationStage { get; set; }
- /// <summary>
- /// 学制
- /// </summary>
- [Comment("学制")]
- [Required]
- public short EducationYears { get; set; }
- /// <summary>
- /// 一对一引用(年级)
- /// </summary>
- public virtual Grade Grade { get; set; }
- /// <summary>
- /// 一对一引用(监测计划)
- /// </summary>
- public virtual ExamPlan ExamPlan { get; set; }
- public void Configure(EntityTypeBuilder<ExamGrade> entityBuilder, DbContext dbContext, Type dbContextLocator)
- {
- entityBuilder.HasIndex(x => new { x.ExamPlanId, x.GradeId }).IsUnique().HasDatabaseName("idx_exam_grade_exam_plan_id_grade_id");
- }
- }
|