示例#1
0
        public Models.SyncState SyncDown(SyncEvent syncEvent, string target, string soupName, Models.SyncOptions options)
        {
            var            soqlsyncDownTarget = JObject.Parse(target);
            var            soqlsyncDown       = new SoqlSyncDownTarget(soqlsyncDownTarget);
            SyncDownTarget syncDown           = soqlsyncDown;
            var            syncOptions        = options != null?SyncOptions.FromJson(JObject.Parse(JsonConvert.SerializeObject(options))) : null;

            var state = _syncManager.SyncDown(syncDown, soupName, syncEvent.OnSyncEventRaised, syncOptions);

            return(Models.SyncState.FromJson(state.AsJson().ToString()));
        }
示例#2
0
        public Models.SyncState SyncUp(SyncEvent syncEvent, Models.SyncUpTarget target, Models.SyncOptions options, string soupName)
        {
            var syncUp      = JsonConvert.SerializeObject(target);
            var syncOptions = JsonConvert.SerializeObject(options, new JsonSerializerSettings
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            });
            var state = _syncManager.SyncUp(JsonConvert.DeserializeObject <SyncUpTarget>(syncUp), SyncOptions.FromJson(JObject.Parse(syncOptions)), soupName, syncEvent.OnSyncEventRaised);

            return(Models.SyncState.FromJson(state.AsJson().ToString()));
        }