Person.cs 838 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using Shouldly;
  3. namespace PetaPoco.Tests.Integration.Documentation.Pocos
  4. {
  5. [TableName("People")]
  6. [PrimaryKey("Id", AutoIncrement = false)]
  7. public class Person
  8. {
  9. [Column]
  10. public Guid Id { get; set; }
  11. [Column(Name = "FullName")]
  12. public string Name { get; set; }
  13. [Column]
  14. public long Age { get; set; }
  15. [Column]
  16. public int Height { get; set; }
  17. [Column]
  18. public DateTime? Dob { get; set; }
  19. [Ignore]
  20. public string NameAndAge => $"{Name} is of {Age}";
  21. public void ShouldBe(Person other)
  22. {
  23. Id.ShouldBe(other.Id);
  24. Name.ShouldBe(other.Name);
  25. Age.ShouldBe(other.Age);
  26. Height.ShouldBe(other.Height);
  27. Dob.ShouldBe(other.Dob);
  28. }
  29. }
  30. }