Esempio n. 1
0
 /// <summary>
 /// Inserts multiple rows into the database inside a transaction.
 /// </summary>
 /// <remarks>
 /// Since all of the inserts are performed inside a transaction, if one of the inserts fail, all of the inserts rollback.
 /// </remarks>
 /// <param name="model">Row to insert.</param>
 /// <returns>If the "LastInsertIdQuery" property is set on the database context, will return the newly inserted row ids in a long[].  Otherwise will return null.</returns>
 public long[] Insert(T[] model)
 {
     using (var statement = new SqlStatement <T>(SqlStatement <T> .Mode.Insert, context)) {
         return(statement.Insert(model));
     }
 }