| 1234567891011121314151617181920212223242526 |
- using InvercargillSql.Orm;
- /**
- * Product entity representing a product in the e-commerce system.
- */
- public class Product : Object {
- public int64 id { get; set; }
- public string name { get; set; }
- public string category { get; set; }
- public double price { get; set; }
- public int64 stock { get; set; }
-
- public Product() {
- name = "";
- category = "";
- }
-
- public static void configure_mapper(EntityMapperBuilder<Product> b) {
- b.table("products")
- .column<int64?>("id", p => p.id, (p, v) => p.id = v)
- .column<string>("name", p => p.name, (p, v) => p.name = v)
- .column<string>("category", p => p.category, (p, v) => p.category = v)
- .column<double?>("price", p => p.price, (p, v) => p.price = v)
- .column<int64?>("stock", p => p.stock, (p, v) => p.stock = v);
- }
- }
|