Ejemplo n.º 1
0
        public static Task ResetAllModificationTimes(this IDataStore ds)
        {
            return(ds.ExecuteInTransactionAsync(ctx => {
                foreach (var type in SqliteDataStore.DiscoverDataObjectTypes())
                {
                    var con = ctx.Connection;
                    var tbl = con.GetMapping(type).TableName;

                    if (type.IsSubclassOf(typeof(CommonData)))
                    {
                        var q = String.Concat(
                            "UPDATE ", tbl, " SET ModifiedAt = ? ",
                            "WHERE RemoteId IS NOT NULL AND DeletedAt IS NULL ",
                            "AND (IsDirty = 0 OR RemoteRejected = 1)");
                        ctx.Connection.Execute(q, DateTime.MinValue);
                    }
                }
            }));
        }
Ejemplo n.º 2
0
 public Context(SqliteDataStore store, string dbPath)
 {
     this.store = store;
     conn       = new SQLiteConnection(dbPath);
 }
Ejemplo n.º 3
0
 public Context(SqliteDataStore store, SQLiteConnection conn)
 {
     this.store = store;
     this.conn  = conn;
     Messages   = new List <DataChangeMessage> ();
 }
Ejemplo n.º 4
0
 public QueryBuilder(SqliteDataStore store, TableQuery <T> query)
 {
     this.store = store;
     this.query = query;
 }