/PetaPoco.Tests/poco.cs
C# | 86 lines | 75 code | 7 blank | 4 comment | 0 complexity | 42d3b250c4b0eb70e6f8764079bd277b MD5 | raw file
1using System; 2using System.Collections.Generic; 3using System.Linq; 4using System.Text; 5using PetaPoco; 6 7namespace PetaPoco.Tests 8{ 9 10 enum State 11 { 12 Yes, 13 No, 14 Maybe, 15 } 16 17 // Non-decorated true poco 18 class poco 19 { 20 public long id { get; set; } 21 public string title { get; set; } 22 public bool draft { get; set; } 23 public DateTime date_created { get; set; } 24 public DateTime? date_edited { get; set; } 25 public string content { get; set; } 26 public State state { get; set; } 27 [Column("col w space")] public int col_w_space { get; set; } 28 public float? nullreal { get; set; } 29 } 30 31 32 // Attributed not-so-true poco 33 [TableName("petapoco")] 34 [PrimaryKey("id", sequenceName="article_id_seq")] 35 [ExplicitColumns] 36 class deco 37 { 38 [Column] public long id { get; set; } 39 [Column] public string title { get; set; } 40 [Column] public bool draft { get; set; } 41 [Column] public DateTime date_created { get; set; } 42 [Column] public DateTime? date_edited { get; set; } 43 [Column] public string content { get; set; } 44 [Column] public State state { get; set; } 45 [Column("col w space")] public int col_w_space { get; set; } 46 [Column] public float? nullreal { get; set; } 47 } 48 // Attributed not-so-true poco 49 [TableName("petapoco")] 50 [PrimaryKey("id")] 51 [ExplicitColumns] 52 class deco_explicit 53 { 54 [Column]public long id { get; set; } 55 [Column]public string title { get; set; } 56 [Column]public bool draft { get; set; } 57 [Column]public DateTime date_created { get; set; } 58 [Column]public State state { get; set; } 59 public string content { get; set; } 60 [Column("col w space")]public int col_w_space { get; set; } 61 [Column] public float? nullreal { get; set; } 62 } 63 64 // Attributed not-so-true poco 65 [TableName("petapoco")] 66 [PrimaryKey("id")] 67 class deco_non_explicit 68 { 69 public long id { get; set; } 70 public string title { get; set; } 71 public bool draft { get; set; } 72 public DateTime date_created { get; set; } 73 public State state { get; set; } 74 [Ignore] public string content { get; set; } 75 [Column("col w space")] public int col_w_space { get; set; } 76 public float? nullreal { get; set; } 77 } 78 79 [TableName("petapoco2")] 80 [PrimaryKey("email", autoIncrement=false)] 81 class petapoco2 82 { 83 public string email { get; set; } 84 public string name { get; set; } 85 } 86}