You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
742 B

  1. using System;
  2. using System.ComponentModel.DataAnnotations.Schema;
  3. using System.Text;
  4. namespace EF_Code_First.Models
  5. {
  6. public class Grade
  7. {
  8. public int GradeId { get; set; }
  9. public string? GradeName { get; set; }
  10. public string? Section { get; set; }
  11. [ForeignKey("StudentId")]
  12. public ICollection<Student>? Students { get; set; }
  13. public override string ToString()
  14. {
  15. StringBuilder builder = new StringBuilder();
  16. builder.Append(GradeId);
  17. builder.Append('\u002C');
  18. builder.Append(GradeName);
  19. builder.Append('\u002C');
  20. builder.Append(Students.Count);
  21. return builder.ToString();
  22. }
  23. }
  24. }