This project is read-only.

Inserting strongly typed objects

Sep 27, 2011 at 5:15 PM

Is it possible to perform an insert with a strongly typed object?  Currently I'm only able to insert data using anonymous objects which offers no type safety.


var bank = new Bank("BankName");
db.InsertDataInto("Banks", bank, true);
var bank = new Bank("BankName");
db.InsertDataInto<Bank>("Banks", bank, false);

Sep 27, 2011 at 5:36 PM

I think I figured out why this doesn't work.  If any of the object's properties are null, a null reference exception is thrown bc there is no null check when building the insert command string.