// the list of entitiies
        private IList <BCUserEntity> NewUserEntitiesFromJsonString(string in_json, JsonData in_entities)
        {
            List <BCUserEntity> entities = new List <BCUserEntity>();

            /*
             * IDictionary d = jsonObj["data"] as IDictionary;
             * if (d == null || !d.Contains("entities"))
             * {
             *  return entities;
             * }
             */
            try
            {
                //foreach (JsonData child in in_entities)
                JsonData child = null;
                for (int i = 0; i < in_entities.Count; ++i)
                {
                    child = in_entities[i];
                    BCUserEntity entity = null;
                    entity = NewUserEntity((string)child["entityType"]);
                    entity.ReadFromJson(child);
                    entities.Add(entity);
                }
            }
            catch (System.Exception)
            {
                /* do nadda */
            }

            return(entities);
        }
        public BCUserEntity NewUserFromDictionary(Dictionary <string, object> in_dict)
        {
            BCUserEntity toReturn = null;

            if (in_dict != null)
            {
                try
                {
                    toReturn = NewUserEntity((string)in_dict["entityType"]);
                    toReturn.ReadFromJson(in_dict);
                }
                catch (Exception)
                {
                    /* do nadda */
                }
            }

            return(toReturn);
        }
Beispiel #3
0
        // the list of entitiies
        private IList <BCUserEntity> NewUserEntitiesFromJsonString(string json, JsonData entitiesJson)
        {
            List <BCUserEntity> entities = new List <BCUserEntity>();
            JsonData            child    = null;

            for (int i = 0; i < entities.Count; ++i)
            {
                try
                {
                    child = entitiesJson[i];
                    BCUserEntity entity = null;
                    entity = NewUserEntity((string)child["entityType"]);
                    entity.ReadFromJson(child);
                    entities.Add(entity);
                }
                catch (System.Exception)
                {
                    /* do nadda */
                }
            }
            return(entities);
        }