Beispiel #1
0
 public Task <T> ExecuteScalarAsync <T>(string sql, params object[] args)
 {
     return(Task <T> .Factory.StartNew(
                () =>
     {
         SqliteSession conn = this.GetAsyncConnection();
         using (conn.Lock())
         {
             return conn.ExecuteScalar <T>(sql, args);
         }
     }));
 }
Beispiel #2
0
 public Task <T> GetAsync <T>(object pk, params object[] primaryKeys) where T : new()
 {
     return(Task.Factory.StartNew(
                () =>
     {
         SqliteSession conn = this.GetAsyncConnection();
         using (conn.Lock())
         {
             return conn.Get <T>(pk, primaryKeys);
         }
     }));
 }
Beispiel #3
0
 public Task <int> ClearTableAsync <T>() where T : new()
 {
     return(Task.Factory.StartNew(
                () =>
     {
         SqliteSession conn = this.GetAsyncConnection();
         using (conn.Lock())
         {
             return conn.ClearTable <T>();
         }
     }));
 }
Beispiel #4
0
 public Task <int> ExecuteAsync(string query, params object[] args)
 {
     return(Task <int> .Factory.StartNew(
                () =>
     {
         SqliteSession conn = this.GetAsyncConnection();
         using (conn.Lock())
         {
             return conn.Execute(query, args);
         }
     }));
 }
Beispiel #5
0
 public Task <int> UpdateAllAsync <T>(string propertyName, object propertyValue)
 {
     return(Task.Factory.StartNew(
                () =>
     {
         SqliteSession conn = this.GetAsyncConnection();
         using (conn.Lock())
         {
             return conn.UpdateAll <T>(propertyName, propertyValue);
         }
     }));
 }
Beispiel #6
0
 public Task <int> DeleteAsync <T>(T item)
 {
     return(Task.Factory.StartNew(
                () =>
     {
         SqliteSession conn = this.GetAsyncConnection();
         using (conn.Lock())
         {
             return conn.Delete(item);
         }
     }));
 }
Beispiel #7
0
 public Task <List <T> > QueryAsync <T>(string sql, params object[] args) where T : new()
 {
     return(Task <List <T> > .Factory.StartNew(
                () =>
     {
         SqliteSession conn = this.GetAsyncConnection();
         using (conn.Lock())
         {
             return conn.Query <T>(sql, args);
         }
     }));
 }
Beispiel #8
0
 public Task <int> InsertAsync <T>(T item, ConflictResolution extra)
 {
     return(Task.Factory.StartNew(
                () =>
     {
         SqliteSession conn = this.GetAsyncConnection();
         using (conn.Lock())
         {
             return conn.Insert(item, extra);
         }
     }));
 }
Beispiel #9
0
 public Task <int> InsertAllAsync <T>(IEnumerable <T> items)
 {
     return(Task.Factory.StartNew(
                () =>
     {
         SqliteSession conn = this.GetAsyncConnection();
         using (conn.Lock())
         {
             return conn.InsertAll(items);
         }
     }));
 }
Beispiel #10
0
 public Task <T> GetAsync <T>(Expression <Func <T, bool> > expression) where T : new()
 {
     return(Task.Factory.StartNew(
                () =>
     {
         SqliteSession conn = this.GetAsyncConnection();
         using (conn.Lock())
         {
             return conn.Get(expression);
         }
     }));
 }
Beispiel #11
0
 public Task <int> InsertDefaultsAsync <T>()
     where T : class
 {
     return(Task.Factory.StartNew(
                () =>
     {
         SqliteSession conn = this.GetAsyncConnection();
         using (conn.Lock())
         {
             return conn.InsertDefaults <T>();
         }
     }));
 }