public override IDictionary<string, object> Serialize(object obj, JavaScriptSerializer serializer)
        {
            if (obj == null) return new Dictionary<string, object>();
            DictionaryBasedEntity entity = ((DictionaryBasedEntity)obj);

            IDictionary<string, object> properties = new Dictionary<string, object>(entity.GetProperties());
            return properties;
        }
 public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
 {
     DictionaryBasedEntity entity = (DictionaryBasedEntity)Activator.CreateInstance(type);
     entity.SetProperties(dictionary);
     return entity;
 }