Exemplo n.º 1
0
        public static string SerializeUserDataArrayToJson(UserData[] userDataArray)
        {
            var array = new object[userDataArray.Length];

            for (int i = 0; i < userDataArray.Length; i++)
            {
                array[i] = UserDataParser.SerializeUserDataToDictionary(userDataArray[i]);
            }
            return(Json.Serialize(array));
        }
Exemplo n.º 2
0
        public static UserData[] DeserializeJsonToUserDataArray(string text)
        {
            var array         = Json.Deserialize(text) as List <object>;
            var userDataArray = new UserData[array.Count];

            for (int i = 0; i < array.Count; i++)
            {
                userDataArray[i] = UserDataParser.DeserializeJsonToDictionary(array[i] as Dictionary <string, object>);
            }
            return(userDataArray);
        }