Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.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# 列表<;字符串>;和字符串[]WCF?_C#_.net_Wcf - Fatal编程技术网

C# 列表<;字符串>;和字符串[]WCF?

C# 列表<;字符串>;和字符串[]WCF?,c#,.net,wcf,C#,.net,Wcf,我创建了一个WCF服务并公开了一个函数,该函数接受列表作为参数 public bool Execute(string databaseServer, string database, string ClientName, string ERAPayerID, string PlanPriority, List<string> AdjCode, List<string> RemarkCode, List<string> CPT, string Modifier,

我创建了一个WCF服务并公开了一个函数,该函数接受列表作为参数

public bool Execute(string databaseServer, string database, string ClientName, string ERAPayerID, string PlanPriority, List<string> AdjCode, List<string> RemarkCode, List<string> CPT, string Modifier, string renderingProviderNPI)

如果我只接受列表,我该怎么办?

这与您添加服务引用的方式有关。您可以在添加服务引用时选择集合类型


添加服务引用->输入您的Url,使用高级按钮您可以选择
系统.集合.通用.列表
作为集合选项。

这与您添加服务引用的方式有关。您可以在添加服务引用时选择集合类型


添加服务参考->输入您的Url,使用高级按钮您可以选择收集选项的
System.Collection.Generic.List

您为什么要接受列表?超过90%的情况下,您只需要对参数执行
foreach
,所以您只需要一个
IEnumerable
。因为我在服务端有一些逻辑,它是基于.isGenericType==true或false来决定的。
List
并不比
IEnumerable
更通用……您为什么要接受列表?超过90%的情况下,您只需要对参数执行
foreach
,所以您只需要一个
IEnumerable
。因为我在服务端有一些逻辑,它是基于.isGenericType==true或false来决定的。一个
列表
并不比一个
IEnumerable
…完美!工作得很有魅力谢谢你!工作很有魅力谢谢
WriteOffServiceClient client = new WriteOffServiceClient();
bool resutl = client.Execute("server", "database", practiseIdentifier, "", ERAPayerId, pPriority, new List<string>, new List<string>, new List<string>, "", "");
WriteOffServiceClient client = new WriteOffServiceClient();
bool resutl = client.Execute("server", "database", practiseIdentifier, "", ERAPayerId, pPriority, new string[5], new string[5], new string[5], "", "");