在 PetaPoco 网站上给出的示例中,这是装饰类的方法:
[PetaPoco.TableName("articles")]
[PetaPoco.PrimaryKey("article_id")]
public class article
{
public long article_id { get; set; }
public string title { get; set; }
public DateTime date_created { get; set; }
public bool draft { get; set; }
public string content { get; set; }
}
但是假设文章表被建模为有 2 列:article_id 和 title 作为其主键(而不仅仅是 article_id),那么 PetaPoco 中的装饰会是什么样子。