c# - 如何删除数据成员上的命名空间?

标签 c# wcf

我没有代码,但基本上我有一个 wcf datacontract,它有大约 20 个数据成员,每个数据成员都是自定义类型。

当通过网络发送时,我有

      <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>

如何删除数据成员上的命名空间?

在一个案例中,我返回了一个巨大的数据契约(Contract)列表,其中 80% 的数据包是命名空间。

在那种情况下,带宽对我来说是个问题。

最佳答案

通过这样做

     [DataContract(Namespace = "")] 

在我的自定义类中,它删除了我需要的内容。

关于c# - 如何删除数据成员上的命名空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7829998/

相关文章:

c# - 如何更改 Windows Phone 8,8.1 中的默认视频捕获分辨率

c# - Swagger UI 尝试操作方法不替换路由参数,而是发送占位符 "{paramName}"

c# - 响应消息的内容类型 application/xml;charset=utf-8 与绑定(bind)的内容类型不匹配 (text/xml; charset=utf-8)

c# - IIS 中的 WCF,http 基本身份验证 - Windows 用户 "security"含义

vb.net - 使用包含 Excel VBA 内的 DataContract 的 wcf 服务

c# - XSLT,将所有负节点和所有节点求和为绝对值

c# - 非根对象的 JSON 反序列化

c# - 将 CSV 加载到 SQL Server 错误

c# - 如何通过成员(member)/授权在 Azure 上启用 WCF 服务的流传输?

c# - 计算对象增量