Dapper Contrib - Data Annotation - Table

Description

Specifie the destination table name mapped to the entity.

  1. [Table("Invoice")]
  2. public class InvoiceContrib
  3. {
  4. [Key]
  5. public int InvoiceID { get; set; }
  6. public string Code { get; set; }
  7. public InvoiceKind Kind { get; set; }
  8. [Write(false)]
  9. [Computed]
  10. public string FakeProperty { get; set; }
  11. }
  12. using (var connection = My.ConnectionFactory())
  13. {
  14. connection.Open();
  15. var invoice = connection.Get<InvoiceContrib>(1);
  16. }