我想要一个包装器,无论是类还是任何列表类型,都可以保存多个属性。我想存储这些属性的值并稍后检索。我创建了一个类并进行了一些操作,如下所示。
internal class Dependencies
{
public string issueID;
public int dependencyCheck;
public string jirastatus;
public Dependencies()
{
this.issueID = string.Empty;
this.dependencyCheck = 0;
this.jirastatus = string.Empty;
}
//Calling this function.
preapreIssuesList(IssueKey, JIRAtoken);
private static void preapreIssuesList(string IssueKey,string JIRAtoken)
{
Dependencies dependeant = new Dependencies();
if (!dependeant.issueID.Contains(IssueKey))
{
dependeant.issueID = IssueKey;
JiraSoapServiceService jira = new JiraSoapServiceService();
RemoteIssue ri = jira.getIssue(JIRAtoken, (IssueKey).ToString());
dependeant.jirastatus = Enum.GetName(typeof(GetChangesets.JIRAOperations.JIRAStatus), Convert.ToInt32(ri.status));
dependeant.dependencyCheck = 0;
}
else if (dependeant.issueID.Contains(IssueKey))
{
dependeant.dependencyCheck = 1;
}
}
如果我这样做,它会保存存储的值吗?还是最好采用Dependencies
类型List<>
?有人可以建议我回答吗?