0
我得到XmlReader與數據。如何將它轉換爲ASP.NET Core MVC中的JSON?XML到JSON在ASP.NET核心MVC
例如:
using (SqlCommand command = new SqlCommand("SELECT * FROM Sample for XML AUTO", connection as SqlConnection)){
XmlReader xml = command.ExecuteXmlReader();
xml.Read();
//convert xml.ReadOuterXml() to json
return new ObjectResult(json);
}