/// <summary> /// Deletes all the objects passed as parameters from the database. /// If recursive flag is set to true, all relationships marked with 'CascadeDelete' will be /// deleted from the database recursively. Inverse relationships and closed entity loops are handled /// correctly to avoid endless loops /// </summary> /// <param name="conn">SQLite Net connection object</param> /// <param name="recursive">If set to <c>true</c> all relationships marked with 'CascadeDelete' will be /// deleted from the database recursively</param> /// <param name="element">Object to be deleted from the database</param> public static void Delete(this SQLiteConnection conn, object element, bool recursive) { if (recursive) { conn.DeleteAll(new [] { element }, recursive); } else { conn.Delete(element); } }