Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在c中生成的代理类中列出vs数组#_C#_Wcf - Fatal编程技术网

C# 在c中生成的代理类中列出vs数组#

C# 在c中生成的代理类中列出vs数组#,c#,wcf,C#,Wcf,我有一个WCF服务,当我使用svcutil生成客户机代理类时,它将我的列表属性更改为数组。是否有一个选项可以确保在不修改C#中生成的类的情况下维护列表 //服务中的对象… [System.CodeDom.Compiler.GeneratedCodeAttribute(“svcutil”,“3.0.4506.2152”)] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [Sy

我有一个WCF服务,当我使用svcutil生成客户机代理类时,它将我的列表属性更改为数组。是否有一个选项可以确保在不修改C#中生成的类的情况下维护列表

//服务中的对象…
[System.CodeDom.Compiler.GeneratedCodeAttribute(“svcutil”,“3.0.4506.2152”)]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute(“代码”)]
[System.Xml.Serialization.XmlTypeAttribute(命名空间=”http://brax.com/data/Query")]
公共部分类PayloadType
{
私有列表personBasedQueryField;
私有列表基于位置的查询字段;
//生成的类。。。
[System.CodeDom.Compiler.GeneratedCodeAttribute(“svcutil”,“3.0.4506.2152”)]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute(“代码”)]
[System.Xml.Serialization.XmlTypeAttribute(命名空间=”http://brax.com/data/Query")]
公共部分类PayloadType
{
私有PersonType[]personBasedQueryField;
私有位置类型[]基于位置的查询字段;

当您通过在Visual Studio中添加服务引用来创建客户端代理时,您可以稍后编辑该配置。在该编辑对话框中,您可以指定是否要包含数组、列表和可观察集合(我认为还有更多选项)


使用svcutil,我不知道是否可以更改该选项。

当您通过在Visual Studio中添加服务引用来创建客户端代理时,您可以稍后编辑该配置。在该编辑对话框中,您可以指定是否要有数组、列表、可观察集合(我认为还有更多的选择)


使用svcutil,我不知道是否可以更改该选项。

是的,Visual Studio中的服务引用中有一些选项。您可以选择将集合生成为列表

更新:如果您正在使用,可以使用以下选项:

/collectionType:<type>
/collectionType:

是的,Visual Studio中的服务引用中有一些选项。您可以选择将集合生成为列表

更新:如果您正在使用,可以使用以下选项:

/collectionType:<type>
/collectionType:

右键单击ServiceReference,选择配置服务引用。然后将集合类型更改为System.Collections.Generic.List。

右键单击ServiceReference,选择配置服务引用。然后将集合类型更改为System.Collections.Generic.List。

使用svcutil.exe时,可以使用/collectionType:选项。使用svcutil.exe时,可以使用/collectionType:选项。