Open GoogleCodeExporter opened 8 years ago
That is because our constructor is adding them to a newly constructed object;
there are a number of ways of avoiding this:
- don't use the constructor to put data into lists of new objects!
- turn off the constructor: see SkipConstuctor in ProtoContract
- tell it overwrite the list (Via ProtoMember, but not the best option here)
- use a serialization callback to clear the list at the start of deserialization
The "append" behaviour is because protobuf (the Google spec) **is** explicitly
appendable and merge able, with any new list elements beig appended rather than
replacing existing content
Original comment by marc.gravell
on 26 Dec 2011 at 9:10
Thanks for the response, I just fill the array at constructor to see the
situation, actually turn of constructor worked for me, "SkipConstuctor=true".
Thanks.
Original comment by emre.ser...@gmail.com
on 26 Dec 2011 at 4:21
Original issue reported on code.google.com by
emre.ser...@gmail.com
on 25 Dec 2011 at 11:30