问题描述
我介入其间的一个项目。所以我是.net的新手,无法找到下面提到的回复代码。任何帮助将不胜感激:
怀疑是在返回关键字之后,需要重新调整什么?
Hi,
I am into one project in between. So i am new to .net and unable to find out what to return in hte code mentioned below. Any help would be appreciated:
doubt is after return keyword, what to retuen?
List<string> int getupdatedetails(int id)
{
string servername = string.Format("{0}.{1}", Environment.MachineName, System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName);
var uri = new Uri(string.Format("http://{0}//relativity.services/", servername));
using (ArtifactManagerProxy proxy = new ArtifactManagerProxy(uri))
{
string emailaddress="";
var querys = new DTOs.Query<dtos.rdo>();
querys.ArtifactTypeGuid = GUIDCollection.O_PERSON_GUID;
DTOs.QueryResultSet<DTOs.RDO> results = proxy.Repositories.RDO.Query(querys)
if (!results.Success)
{
Utils.WriteToLog(": query for Tasks failed: " + results.Message);
throw new Exception(": query for Tasks failed: " + results.Message);
}
else
{
foreach(var res in results.Results)
{
emailaddress+= res.artifact.fields[0].value.tostring();
}
}
return
}
我尝试了什么:
尝试返回Ture,false并且它无法正常工作并且提供错误说明不能转换List< string>。
What I have tried:
Tried returning Ture, false and it is not working and giving error stating cannot convert the List<string>.
推荐答案
List<string> int getupdatedetails(int id)
</string>
你只能退回一种类型。那么您需要返回什么, int
或 List< string>< / string>
?并且你的 return
语句都不完整,因为它没有返回值。
you can only return one type. So what do you need to return, an int
or a List<string></string>
? And your return
statement is incomplete either way, since it has no return value.
这篇关于如何返回列表< string>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!