Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to remove namespace on datamember?

Tags:

c#

wcf

I don't have the code with me but basically what I have is a wcf datacontract having about 20 datamember which each one is a custom type.

when sent over the wire, I have

      <datamembername namespace>
            <few properties here>
            <few properties here>
            <few properties here>
      <datamembername>
      <datamembername namespace>
            <few properties here>
            <few properties here>
            <few properties here>
      <datamembername>
      <datamembername namespace>
            <few properties here>
            <few properties here>
            <few properties here>
      <datamembername>

how could I remove the namespace on the datamember?

in one case I return a huge list of that datacontract and 80% of the packet is the namespace.

bandwidth is a problem for me in that case.

like image 206
Fredou Avatar asked Oct 20 '11 01:10

Fredou


1 Answers

by doing this

     [DataContract(Namespace = "")] 

on my custom class, it removed what I needed.

like image 86
Fredou Avatar answered Sep 30 '22 15:09

Fredou