Re: Serialization Issues and bloated objects
- From: wawang@xxxxxxxxxxxxxxxxxxxx (Walter Wang [MSFT])
- Date: Tue, 23 Jan 2007 02:14:54 GMT
Hi Sagi,
I see.
Let's take following code for example:
[Serializable]
public class Member
{
private Policies _policies = new Policies();
(I have the policies collection created by default).
Then I have following code in Page_Load():
Profile.Member.Age = 1;
Profile.Member.Name = "Name";
Profile.Member.Policies.Add(new Policy(1, "n1"));
Profile.Member.Policies.Add(new Policy(2, "n2"));
Refreshing the page several times, and you will see duplicated policy
objects in the serialized text. This is because I'm not checking if the
policies collection is initialized or not before adding new policy objects.
Note that since Profile has already saved the object for us, when we
execute the code second time, there're already policies objects there.
If in doubt, please post some of your code how you're reading/writing the
profile. Thanks.
Regards,
Walter Wang (wawang@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Follow-Ups:
- Re: Serialization Issues and bloated objects
- From: Shkedy
- Re: Serialization Issues and bloated objects
- References:
- Serialization Issues and bloated objects
- From: Shkedy
- RE: Serialization Issues and bloated objects
- From: Walter Wang [MSFT]
- Re: Serialization Issues and bloated objects
- From: Shkedy
- Serialization Issues and bloated objects
- Prev by Date: Re: Convert.ToInt32("0") throws an exception, some systems
- Next by Date: Re: Logging In Enterprise Library
- Previous by thread: Re: Serialization Issues and bloated objects
- Next by thread: Re: Serialization Issues and bloated objects
- Index(es):
Relevant Pages
|