I need to create method which will concatenate multiple Xelements into one. I created below method:
static void DoStuff(string IP, string login, string password, string port)
{
CommonMethods cm = new CommonMethods();
WebClient webClient = new WebClient();
XElement output = null;
try
{
webClient = cm.ConnectCiscoUnityServerWebClient(IP, login, password);
int rowsPerPage = 100;
int pageNumber = 1;
Console.WriteLine("Getting logins from " + IP);
do
{
Console.WriteLine("Downloading " + pageNumber + " page");
string uri = @"https://" + IP + ":" + port + "/vmrest/users?bla&rowsPerPage=" + rowsPerPage + "&pageNumber=" + pageNumber;
Stream stream = webClient.OpenRead(uri);
output = XElement.Load(stream);
pageNumber++;
}
while (output.HasElements);
Console.WriteLine(output);
}
catch (Exception ex)
{
cm.LogErrors(ex.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name.ToString());
}
}
but in Do While loop the output is overwritten. Could you please provide me some solution which will concatenate the output into one?