I have a Windows Communication Foundation service which queries the Entity Framework and retrieves data in the form of Entity objects. I’d like to serialize these objects to JSON and send them back to the client to be interpreted in Javascript.
It seems this is tricky, according posts like these:
I would also recommend not seralizing you actual domain entity and use some form of simplified DTO. Lazy loaded collections/relationships can cause all kinds of problems and you don’t want to polute your entity with Json related attributes. A DTO mapped with AutoMapper is generally a good way to go