serializer

Why does Json.Net call the Equals method on my objects when serializing?

故事扮演 提交于 2019-11-28 00:29:35
问题 I just ran into an error when I was using the Newtonsoft.Json SerializeObject method. It has been asked before here, but there was no answer from the people working with Newtonsoft as to why this happens. Basically, when calling SerializeObject like this: string json = Newtonsoft.Json.JsonConvert.SerializeObject(from, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All }); I get errors in a lot of Equals methods I have overridden in my classes: public override bool Equals

Disable Doctrine 2 lazy loading when using JMS Serializer?

夙愿已清 提交于 2019-11-27 20:12:38
Im using Doctrine 2 ORM in my Zend project and need to serialize my Entities to JSON in several cases. ATM i use the Querybuilder and join all tables i need. But my serializer causes doctrine to lazy load every associated Entity which results in pretty huge data amounts and provokes recursion. Now im looking for a way to totally disable Doctrines lazy loading behavior. My way to select data would be the following: $qb= $this->_em->createQueryBuilder() ->from("\Project\Entity\Personappointment", 'pa') ->select('pa', 't', 'c', 'a', 'aps', 'apt', 'p') ->leftjoin('pa.table', 't') ->leftjoin('pa

Custom WCF DataContractSerializer

会有一股神秘感。 提交于 2019-11-27 08:42:55
Is it possible to replace dataContractSerializer in Windows Communication Foundation with my own serializer. If it is possible, how can I achieve this? Drew Marsh Yes, you can provide your own serializer implementation. By default WCF will use the DataContractSerializer . To provide your own serializer you must write your own IOperationBehavior which seeks out and removes the currently applied DataContractSerializerOperationBehavior from the OperationDescription::Behaviors collection and then applies a custom instance of an DataContractSerializerOperationBehavior . The

Disable Doctrine 2 lazy loading when using JMS Serializer?

谁说胖子不能爱 提交于 2019-11-26 22:55:10
问题 Im using Doctrine 2 ORM in my Zend project and need to serialize my Entities to JSON in several cases. ATM i use the Querybuilder and join all tables i need. But my serializer causes doctrine to lazy load every associated Entity which results in pretty huge data amounts and provokes recursion. Now im looking for a way to totally disable Doctrines lazy loading behavior. My way to select data would be the following: $qb= $this->_em->createQueryBuilder() ->from("\Project\Entity\Personappointment

Custom WCF DataContractSerializer

≡放荡痞女 提交于 2019-11-26 14:16:28
问题 Is it possible to replace dataContractSerializer in Windows Communication Foundation with my own serializer. If it is possible, how can I achieve this? 回答1: Yes, you can provide your own serializer implementation. By default WCF will use the DataContractSerializer. To provide your own serializer you must write your own IOperationBehavior which seeks out and removes the currently applied DataContractSerializerOperationBehavior from the OperationDescription::Behaviors collection and then