XmlIgnore

Posts   
 
    
simon831
User
Posts: 152
Joined: 19-Jan-2006
# Posted on: 05-Jun-2008 15:07:46   

Can I add an [XmlIgnore] attribute to a mapped column?

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 05-Jun-2008 15:42:44   

I think you can, but take care, re-generating the code would overwrite it.

simon831
User
Posts: 152
Joined: 19-Jan-2006
# Posted on: 05-Jun-2008 16:14:15   

Walaa wrote:

I think you can, but take care, re-generating the code would overwrite it.

smile yes, I know I literally could edit the code - but re-generating would definately overwrite it. No good. Is there a way to mark the column as XmlIgnore in the designer?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 05-Jun-2008 17:10:24   

You're using selfservicing or adapter? You can't mark it in the designer as xml ignore. Is there a reason you want to hide it? If you want to exclude the data to be xml serialized, you can also exclude the field in fetching the data. If you're using adapter, you get with compact25 (the default) format XML which then doesn't contain that field.

Frans Bouma | Lead developer LLBLGen Pro
simon831
User
Posts: 152
Joined: 19-Jan-2006
# Posted on: 05-Jun-2008 17:44:40   

Otis wrote:

You're using selfservicing or adapter?

adapter

Otis wrote:

Is there a reason you want to hide it?

The particular application uses some columns locally that will never be needed by remote clients over webservices. This seems like a good way to stop unneccessary data being sent.

I know I can use ExcludeIncludeFieldsList. But its something thats easily forgot when writing new methods.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 06-Jun-2008 09:41:51   

If you want to to stop unneccessary data being sent, then maybe you need to use DTOs.