API
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

Person.cs 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System.ComponentModel.DataAnnotations;
  2. using System.ComponentModel.DataAnnotations.Schema;
  3. using UnivateProperties_API.Helpers.Attributes;
  4. namespace UnivateProperties_API.Model.Users
  5. {
  6. public class Person : BaseEntity
  7. {
  8. #region Constructor
  9. public Person()
  10. {
  11. }
  12. #endregion Constructor
  13. #region Properties
  14. [ForeignKey("User")]
  15. public int? UserId { get; set; }
  16. public string Name { get; set; }
  17. public string Surname { get; set; }
  18. [NotMapped]
  19. [VisibleInListView]
  20. public string FullName
  21. {
  22. get
  23. {
  24. return $"{Name} {Surname}";
  25. }
  26. }
  27. [VisibleInListView(true)]
  28. [DataType(DataType.EmailAddress)]
  29. public string Email { get; set; }
  30. [VisibleInListView(false)]
  31. [Phone]
  32. public string Telephone { get; set; }
  33. [Phone]
  34. public string CellNumber { get; set; }
  35. public virtual User User { get; set; }
  36. #endregion Properties
  37. public override string ToString()
  38. {
  39. return $"{Name} {Surname}";
  40. }
  41. }
  42. }