誰かが以下の場所を手伝ってくれませんか(クエリを作成するのに苦労しています)
XML
<?xml version="1.0" encoding="UTF-8"?>
<response id="1545346343">
<date>2013-10-01 12:01:55.532999</date>
<status>
<current>open</current>
<change_at>16:00:00</change_at>
</status>
<message>Market is open</message>
</response>
クラス
public class MarketClockResponse
{
public Response response { get; set; }
}
public class Response
{
public string Id { get; set; }
public string date { get; set; }
public Status status { get; set; }
public string message { get; set; }
}
public class Status
{
public string current { get; set; }
public string change_at { get; set; }
}
私の解決策:
public void example3()
{
var xElem = XElement.Load("test.xml");
var myobject = xElem.Descendants("response").Select(
x => new MarketClockResponse
{
//Struggling to proceed from here
});
}