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.

37 lines
1.0 KiB

  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Text;
  3. namespace EF_Code_First.Models
  4. {
  5. public class Student
  6. {
  7. public int StudentId { get; set; }
  8. public string? StudentName { get; set; }
  9. public DateTime? DateOfBirth { get; set; }
  10. public byte[]? Photo { get; set; }
  11. public decimal? Height { get; set; }
  12. public float? Weight { get; set; }
  13. [ForeignKey ("Grade")]
  14. public int G_Id { get; set; }
  15. //Navigation Property
  16. public Grade Grade { get; set; }
  17. public override string ToString()
  18. {
  19. StringBuilder builder = new StringBuilder();
  20. builder.Append(StudentId);
  21. builder.Append(" :");
  22. builder.Append(StudentName);
  23. builder.Append(" :");
  24. builder.Append(DateOfBirth);
  25. builder.Append(" :");
  26. builder.Append(Weight);
  27. builder.Append(" :");
  28. builder.Append(Height);
  29. return builder.ToString();
  30. }
  31. }
  32. }