C# 列表<;字符串>;和字符串[]WCF?
我创建了一个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,
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], "", "");