I am using .net 4.0 and wcf service. I have business entity classes which is not defined with [Datacontract]
attribute.
When I try to retrieve less than 1000 records of type business entity class it works fine but when I try retrieving more than 1000 records of type business entity class, it throws this exception:
The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:Securities. The InnerException message was 'Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota. '. Please see InnerException for more details.
The problem got solved, when using the [DataContract]
attribute defined for the business entity class.
- so what importance does the
[DataContract]
attribute play in the above case? - what is the difference between using a business entity class defined with
[DataContract]
attribute and without[DataContract]
attribute?