I don't want to use foreach loop to write the contents in xml.is there any other way so that we
can not use foreach loop inside the controller to write xml content..
Here is my code..
var blog = _api.GetAllBlogCategory().ToList();
StreamWriter writer = new StreamWriter(Server.MapPath("~/XmlFiles/BlogCategory.xml"));
writer.WriteLine(@"");
writer.WriteLine("");
foreach(var blogitems in blog)
{
writer.WriteLine("");
writer.WriteLine("");
}
writer.WriteLine("");
writer.Close();

Manas MohapatraRank #182 · 13.2K reputationPosted Jul 26, 2016, 12:44 AM EDT
sourabh choubey173 reputationPosted Jul 26, 2016, 2:34 AM EDT