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();
sourabh choubeyPosted Jul 26, 2016, 6:34 AM
Manas MohapatraPosted Jul 26, 2016, 4:44 AM