예제 #1
0
 // Extensions
 public void InsertWithChildren(T entity)
 {
     //using (SQLiteConnection _dbManager = new SQLiteConnection(_baseUrl.GetDatabasePath(), WriteOnlyFlags))
     using (SQLiteConnectionWithLock _dbManager = new SQLiteConnectionWithLock(new SQLiteConnectionString(_baseUrl.GetDatabasePath(), false, null), SQLiteOpenFlags.ReadWrite | SQLiteOpenFlags.Create | SQLiteOpenFlags.FullMutex | SQLiteOpenFlags.SharedCache))
     {
         using (_dbManager.Lock())
         {
             try
             {
                 _dbManager.InsertWithChildren(entity, true);
             }
             catch (Exception ex)
             {
                 Debug.WriteLine($"SQLiteError: {ex.Message}");
             }
         }
     }
 }