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;
        }
    }
}
