Insert

 

To INSERT the object we simply call a db.Store function

This method stores an object in the database. If the object is present in the database, it will be updated, otherwise it will be inserted.

 

For example:

 

// Create the object we would like to work with.

Cinema cinema = new Cinema() {

         Location = "Sydney",

         OpenDates = new DateTime[] { new DateTime(2003, 12, 10), new DateTime(2003, 10, 3) }

 };

                 

// And here is where the magic begins...

// Store the object - no conversion required.

db.Store(cinema);

 

In fact objects of any complexity can be stored or updated.