var insInvoice = new NpgsqlCommand(
@"INSERT INTO invoice_detail(
invoice_id,
invoice_detail_id,
product_id,
qty,
price,
amount)
VALUES (
:_invoice_id,
:_invoice_detail_id,
:_product_id,
:_qty,
:_price,
:_qty * :_price)", c);
with(var p = insInvoice.Parameters)
{
p.Add("_invoice_id", NpgsqlDbType.Uuid, 0, "invoice_id");
p.Add("_invoice_detail_id", NpgsqlDbType.Uuid, 0, "invoice_detail_id");
p.Add("_product_id", NpgsqlDbType.Uuid, 0, "product_id");
p.Add("_qty", NpgsqlDbType.Integer, 0, "qty");
p.Add("_price", NpgsqlDbType.Numeric, 0, "price");
}
kludge:
for(var p = insInvoice.Parameters; false;)
{
p.Add("_invoice_id", NpgsqlDbType.Uuid, 0, "invoice_id");
p.Add("_invoice_detail_id", NpgsqlDbType.Uuid, 0, "invoice_detail_id");
p.Add("_product_id", NpgsqlDbType.Uuid, 0, "product_id");
p.Add("_qty", NpgsqlDbType.Integer, 0, "qty");
p.Add("_price", NpgsqlDbType.Numeric, 0, "price");
}