I am writing an xml String
and i am passing in two different Lists
and i want to Loop
the items in the List
to continue writing the XML.
public class Results
{
public List<Guid> itemGuid { get; set; }
public List<string> storagePath { get; set; }
public int userId {get; set;}
}
public void CreateOutput(string inFile, string storagePath, int userId)
{
Results results = GetfileInfo(inFile, storagePath);for each of the pages
CheckinXml(results.itemGuid, results.storagePath , userId); //
}
public string CheckinXml(List<Guid> itemGuid, List<string> storagePath, int userId)
{
XDocument xdoc = new XDocument();
xdoc = new XDocument(
new XElement("MyList",
new XElement("Record",
new XElement("ID", itemGuid),
new XElement("StoragePath", storagePath),
new XElement("UploadedUserID", userId)
)
)
);
string result = xdoc.ToString();
return result;
}
currently all the items in the list of itemGuid and the list of storage Path are stored in one string. In my current case i should have three returned XML strings. Should i place the XML in a for loop looping through the list?