Пример #1
0
        //*** QueryEnumerator ***//
        //*** GetAllDocuments ***//

        internal static JObject QueryEnumeratorToJson(QueryEnumerator queryEnumerator)
        {
            var json      = new JObject();
            var rowsArray = new JArray();

            var queryRows = queryEnumerator.GetEnumerator();

            while (queryRows.MoveNext())
            {
                var queryRow     = queryRows.Current;
                var queryRowJson = C8oFullSyncTranslator.DictionaryToJson(queryRow.AsJSONDictionary());
                rowsArray.Add(queryRowJson);
            }

            json[C8oFullSyncTranslator.FULL_SYNC_RESPONSE_KEY_COUNT] = queryEnumerator.Count;
            json[C8oFullSyncTranslator.FULL_SYNC_RESPONSE_KEY_ROWS]  = rowsArray;

            return(json);
        }
Пример #2
0
        //*** DefaultResponse ***//
        //*** Sync, ReplicatePull, ReplicatePush, Reset ***//

        internal static JObject FullSyncDefaultResponseToJson(FullSyncDefaultResponse fullSyncDefaultResponse)
        {
            var json = C8oFullSyncTranslator.DictionaryToJson(fullSyncDefaultResponse.GetProperties());

            return(json);
        }
Пример #3
0
        //*** Document ***//

        internal static JObject DocumentToJson(Document document)
        {
            var json = C8oFullSyncTranslator.DictionaryToJson(document.Properties);

            return(json);
        }