Beispiel #1
0
 public void ReadFromJson(JsonData in_jsonObj)
 {
     m_state      = EntityState.Ready;
     m_entityType = (string)in_jsonObj["entityType"];
     m_entityId   = (string)in_jsonObj["entityId"];
     m_acl        = ACL.CreateFromJson(in_jsonObj["acl"]);
     UpdateTimeStamps(in_jsonObj);
     m_data = JsonToDictionary(in_jsonObj["data"]);
 }
        public void ReadFromJson(object jsonObj)
        {
            Dictionary <string, object> jsonDict = (Dictionary <string, object>)jsonObj;

            m_state      = EntityState.Ready;
            m_entityType = (string)jsonDict["entityType"];
            m_entityId   = (string)jsonDict["entityId"];
            m_acl        = ACL.CreateFromJson((Dictionary <string, object>)jsonDict["acl"]);
            UpdateTimeStamps(jsonDict);
            m_data = JsonToDictionary(jsonDict["data"]);
        }
        public void Test()
        {
            ACL acl = new ACL(ACL.Access.ReadWrite);

            Dictionary <string, object> jsonObj = new Dictionary <string, object> {
                { "other", 1 }
            };

            acl = ACL.CreateFromJson(jsonObj);

            Assert.AreEqual(ACL.Access.ReadOnly, acl.Other);
        }