Пример #1
0
        public Models.SyncState SyncDown(string target, string soupName, string callback,
                                         Models.SyncOptions options)
        {
            var            soqlsyncDownTarget = JObject.Parse(target);
            var            soqlsyncDown       = new SoqlSyncDownTarget(soqlsyncDownTarget);
            SyncDownTarget syncDown           = soqlsyncDown;
            var            action             = JsonConvert.DeserializeObject <Action <SyncState> >(callback);
            var            syncOptions        = JsonConvert.SerializeObject(options);
            var            state     = _syncManager.SyncDown(syncDown, soupName, action, SyncOptions.FromJson(JObject.Parse(syncOptions)));
            var            syncState = JsonConvert.SerializeObject(state);

            return(JsonConvert.DeserializeObject <Models.SyncState>(syncState));
        }
Пример #2
0
        public Models.SyncState SyncUp(Models.SyncUpTarget target, Models.SyncOptions options, string soupName, string callback)
        {
            var syncUp      = JsonConvert.SerializeObject(target);
            var action      = JsonConvert.DeserializeObject <Action <SyncState> >(callback);
            var syncOptions = JsonConvert.SerializeObject(options);
            var state       = _syncManager.SyncUp(JsonConvert.DeserializeObject <SyncUpTarget>(syncUp), SyncOptions.FromJson(JObject.Parse(syncOptions)), soupName, action);
            var syncState   = JsonConvert.SerializeObject(state);

            return(JsonConvert.DeserializeObject <Models.SyncState>(syncState));
        }