ViewState serialization - property in user code region of entity

Posts   
 
    
hotchill avatar
hotchill
User
Posts: 180
Joined: 22-Jan-2007
# Posted on: 14-Oct-2007 21:23:29   

Dear all,

I have a property in the user code region of an entity class:


string _customerTitle = string.Empty;

public string CustomerTitle {
    get {
        return this._customerTitle;
    }
    set {
        this._customerTitle = value;
    }
}
// __LLBLGENPRO_USER_CODE_REGION_END

I have a web service that returns instances of this entity class. I use XmlSchemaImporter to generate a web service proxy. With llblgen v2.5 the user code property will survive xml serialization and hence be available at the web service client.

The property does however not survive viewstate serialization. Is there anything I can do to include it?

Thanks, Tore.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 14-Oct-2007 22:20:52   

Hi Tore, please read this related thread: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=10982

David Elizondo | LLBLGen Support Team
hotchill avatar
hotchill
User
Posts: 180
Joined: 22-Jan-2007
# Posted on: 14-Oct-2007 22:36:29   

Thanks, but the link redirects me to: http://www.llblgen.com/tinyforum/default.aspx.

Access restriction?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 15-Oct-2007 02:35:49   

Access restriction?

Yes, sorry about that flushed Here is the code needed to achieve that:

// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
    info.AddValue("name", name, typeof(string));
// __LLBLGENPRO_USER_CODE_REGION_END

and in

// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
    name = info.GetValue("name", typeof(string)).ToString();
// __LLBLGENPRO_USER_CODE_REGION_END
David Elizondo | LLBLGen Support Team
hotchill avatar
hotchill
User
Posts: 180
Joined: 22-Jan-2007
# Posted on: 23-Oct-2007 18:25:04   

It works. Thanks a lot simple_smile

Sorry for my late reply...something caught fire.